Hyper Text Markup Language; HTML
What is it?
- HTML is one of 3 core languages along with JavaScript (NOT JAVA) and CSS which stands for cascading style sheets
- HTML has approximately 142 commands or tags, which instruct the browser how to treat text and images on the website
- If you're just starting out, Google Chrome is the recommended browser because it has some great web development capabilities built-in.
- If there are situations where including a little CSS or Java alongside the HTML examples makes sense, I will be sure to include them as they really go hand in hand, and will make sure to let you know when I do it.
Syntax:
- This is where I explain how the syntax of the example. For example
- Blue Font is purely HTML
- Black Font is content
- Red font is JavaScript and JavaScript functions (WARNING JavaScript and Java are different languages)
- Green font is for CSS
Exampler Statement:
Layout of a Typical Example :
<HTML>
<HEAD>
<TITLE>
The Title of your Website
</TITLE>
</HEAD>
<BODY onload='example();'>
This is where we will add some content for our starter website. Note the "/" on the closing HTML tags
</BODY>
</HTML>
<SCRIPT>
function example()
{
alert("Congratulations on your first Website")
}
</SCRIPT>
|
What's happening in the script above?
- The above code is technically a complete web page. You could copy and paste that text to a text file, save it as a "myWebsite.HTML" and your browser will run it.
- All HTML web pages have an opening <HTML> and closing </HTML> which more or less indicates the beginning and ending of the document.
- The Head Tag is a place where you can put a few advanced things like (JavaScript, CSS, and Meta Data about your website like the Title).
- The Title tags, are exactly what they sound like, the Title of your interent browser tab.
- The body, is where the meat and potatoes of your document will be stored. However, if you notice, there's a little javascript program called "onLoad"
- Which you'll find sounds very specific. On and Load. This means that when the page loads, we want a JavaScript function to run.
- The JavaScript function that we want to run is "Example" which does one thing. Triggers a message box with the words "Congratulations on your first Website"
- As you may have noticed this JavaScript code is written between the two <SCRIPT> </SCRIPT> tags. This is the most common location, although there are exceptinos.
Example Output:
This is the area where I'll provide demonstrations as to what the code will look like, and how you can jazz it up.
See also; HTML Tables
See also; HTML Form
See also; HTML Buttons