JMJ Training - HTML part 1 : JMJ Training - HTML part 1 Learn Web Page Design Step by Step
Create Your Own Web Site
Help Others
Understand How HTML Works
Discover HTML Limitations
About HTML : About HTML Since 1997, the current HTML Version has been 4.01. For many years, there were no plans to go beyond that version. Recently though, a version 5 has been in the works, but is still under development by the W3C.
The W3C is the World Wide Web Consortium, a group that maintains standards of web design, programming and markup. Their website at http://www.w3.org/ has useful tools for the web site programmer to ensure that all errors have been eliminated from the web page before uploading to a web server on the internet and making the page “live”.
The HTML Validator can show where you need to make changes in your page. It can be found at http://validator.w3.org/. It is the most useful tool right now to you as an HTML language coder. You can also find a CSS Validator there.
HTML is actually a Markup Language, as it's name implies, and NOT a Programming Language.
About HTML - continued : About HTML - continued The main difference between programming and markup is that HTML can not actively make something happen.
HTML gives the page proper form and layout, such as positioning of elements on the page, the font and the size and color of the font used. It can also be used to place and position different elements on the page, like images.
Luckily there are other programming languages that play well together with HTML, and by careful use of these other languages, HTML can be manipulated and displayed according to whatever conditions the web programmer desires.
So, first let's learn HTML, then we can learn other languages that will help interpret what we want and then display the correct HTML according to the conditions we specify. This way, we can get the results we need to make the web site owner (or ourselves) happy.
Technically, we are going to learn XHTML, which has become the standard.
XHTML tags : XHTML tags XHTML markup uses Tags to define areas and elements for position, style and design on the web page. In XHTML, ALL tags MUST have a closing tag (example: Bold Text). Closing tags are identical to Opening tags except for the addition of a slash before the tag name. There are a few “Singleton” tags like
(line break) that have no separate closing tag. XHTML REQUIRES all singleton tags to be closed, like this:
.
What is an HTML File?
HTML stands for Hyper Text Markup Language
An HTML file is a text file containing markup tags
The markup tags tell the Web browser how to display the page
An HTML file must have an htm or html(preferred) file extension
An HTML file can be created using a simple text editor like Notepad
What is an XHTML File?
XHTML stands for eXtensible HTML, and is the new web standard
The XHTML standard requires well-formed code (i.e.; without mistakes)
My First Web Page : My First Web Page Type (or Copy/Paste) the following in a new Notepad window:
Title of page
This is my first homepage.
Create a new folder on your Desktop named training and save the new Notepad text file as index.html. Make sure you change the .txt to .html when saving the file. Click on your new file to open it in your web browser.
My First Web Page explained1 : My First Web Page explained1 The first line DOCTYPE is required by the W3C specification, we'll ignore that for now, just know that it should appear in every HTML file you create. I believe it’s better to get into using good practices now than learn it later.
All web pages must have the following tags:
,
,
,
defines the page as a web page so the browser will display it properly. The html tags must surround all content with very few exceptions.
The content between the tags has instructions for the browser, search engines like Yahoo and Google, and can load some initialization scripts from other web programming languages.
The
tags must fall completely between the tags.
The text between the tags define what is shown at the top of your browser when your page loads.My First Web Page explained2 : My First Web Page explained2 Everything between the
tags is what will be displayed on your web page. This is your actual web page content. Everything that you want displayed on your page goes within the tags.
Go ahead, take some time to experiment, and change the title text and the text between the body tags. Just refresh your browser to see the effect of your changes.
Surround your text with the paragraph tag
.
Also try using these Header tags around some text
. They are used for Headings on your web page and are useful tool for Google and other search engines to find your page. Header tags are h1 through h6.
You are now on your way to becoming an HTML expert!
Do it with Style : Do it with Style HTML tags have Attributes that further define the content in between, such as
. Try the bgcolor attribute in your test file.
Web Colors are in RGB format and begin with the # character. The first pair of numbers are the RED value, the second pair represent GREEN, and the third pair is the BLUE value. The numbers are in Hexadecimal(base16) format, 0-15, using letters to represent 10-15. So you have 0-9, then A-F as possible values. You can find charts of web colors on the internet, or experiment by changing the numbers and refreshing your page.
Now with that said, there is a better way to do attributes than define each attribute within each tag, called CSS(Cascading Style Sheets). It is worth learning right alongside with HTML, as it can help keep your coding practices more disciplined from the start.
One more way to use CSS is “inline” styles:
.
CSS (Cascading Style Sheets)? : CSS (Cascading Style Sheets)? With CSS, the style for each tag can be defined once for the whole page, then the same style sheet can be used for every page on your web site so they are consistent, saving you a lot of time coding.
Example: set your
(paragragh) tag to have an indent on the first line, use a certain font family, font size, and font color. Then, each time you use
tags in your page, it will automatically define the content to match the CSS.
There are three ways to use Style Sheets. The first is to use the