Basic Elements of Coding/Programming

Many aspiring programmers believe they only need to learn one way to code. The truth is coding isn’t as simple as that. For instance, when it comes to creating a website, you’ll likely use several different variations of a single language or multiple languages to create the variety of different elements you need. Even the most basic websites typically use CSS, HTML and Javascript, which while similar, have very different uses.

wordpress developer

Introduction To CSS

A Cascading Style Sheet, or CSS for short, works as a template for the website. Instead of you having to code each individual page, a single CSS template allows you to code fonts, backgrounds, colors, text formatting, links, page alignment and more. Basically, if it’s a style element you want on every page, it’s quicker and easier to do it all in one sheet. You can use multiple style sheets throughout the site.

Code for CSS can be placed internally within your HTML between STYLE tags within your HEAD tags. It can also be referenced externally much like you’d link to any other file, but still within the HEAD tags.

Introduction To HTML

HTML is usually the first language a web developer learns. While simple, the right combination of tags and structure is all that’s needed to create a great website. At it’s most basic, you use HTML, HEAD, TITLE and BODY tag pairs. You don’t need fancy software to use HTML. Any text editor will do. The key thing to remember is to always close any open tags with /tagname. Nearly every website utilizes HTML as it’s universally recognized.

Introduction To Javascript

Javascript allows you to add a bit more flair and usefulness. To add it to a webpage, simply use the SCRIPT tags with your Javascript code sandwiched between them. Since there are different script languages, specify the script type like this: SCRIPT language=“Javascript”. This language does a wide range of things such as form validation, using cookies and small applications (games, calculators, etc.). Some older browsers and browsers with Javascript disabled won’t be able to read or use the coding. To avoid this, place all the code between the SCRIPT tags within HTML comments.

Working Together

As you can see, each of these coding types has as specific purpose. While HTML alone is all you need to create a functional site, CSS and Javascript help make life easier and provide more functionality to visitors. Let’s take a look at how the three work together to create a single website.

First, decide what you want the site to look like and create a CSS file in a text editor. The code can easily be copied into your HTML file later. Remember, CSS can be internal (same file as the HTML) or external (separate file referenced within the HTML file).

Next, complete all your desired HTML code to add text, specific images, menus and more. These are the items that’ll be formatted once you incorporate the CSS. Once you’re done, add in the CSS file or code within your HEAD tags. This adds in all your style elements. The same CSS code can be used within multiple HTML files.

Finally, add more functionality by adding in all your different Javascript scripts. You can use as many of these as you want. Use them throughout your HTML code for a more well-rounded and functional site.

Coding isn’t just one language. It’s a variety of languages and language variations working together to create a single project. When used properly, the mixture is the foundation for nearly every website you see.

Leave a Reply