Introduction

Before reading this article please visit the following links:
This article explains the basic parts of HTML that a junior (beginner) needs to know. From juniors I mean all those that have just passed High School or are 14 years or above.

HTML Comments and CSS (Cascading Style Sheets)

Comment tags < !- - and - -> are used to insert comments in HTML.
HTML Comments tags
You can add comments to your HTML page using the following syntax.
  1. < ! - - write your comment here - - >
NOTE
There is an exclamation mark in the opening tag that will not be in the closing tag.
Example
  1. <-- I am a girl -->
  2. <p>I love to write articles..</p
  3. <!-- Remember to add more information here -->
Comments are also great for debugging HTML, because you can comment out HTML lines of code, one at a time, to search for errors.
Example
  1. <!-- Do not display this at the moment<img border="0" src="pic_girl.jpg" alt="Girl">-->
Conditional Comments
You might stumble upon conditional comments in HTML.
  1. <!--[if IE 8]>
  2. .... some HTML here ....
  3. <![endif]-->
Conditional comments define HTML tags to be executed by Internet Explorer only.
Software Program Tags
HTML CSS
CSS means Cascading Style Sheets.
  1. <html>
  2. <head>
  3. <style>
  4. body {background-color:purple}
  5. h1 {color:white}
  6. p {color:blue}
  7. </style>
  8. </head>
  9. <body>
  10. <h1>I am a girl.</h1>
  11. <p>I love to write articles..</p>
  12. </body>
  13. </html>
RESULT
Styling HTML with CSS
Styling can be added to HTML elements in one of the following 3 ways:
CSS Syntax
CSS styling has the following syntax.
element { property:value; property:value }
Inline Styling (Inline CSS)
Internal Styling (Internal CSS)
External Styling (External CSS)
CSS Fonts
The CSS Box Model
Every HTML element has a box around it, even if you cannot see it.
The id Attribute
The class Attribute
Deprecated Tags and Attributes in HTML5

Chapter Summary

  • Comment tags < !- - and - -> are used to insert comments in HTML.
  • Use the HTML style attribute for inline styling.
  • Use the HTML <style> element to define internal CSS.
  • Use the HTML <link> element to refer to an external CSS file.
  • Use the HTML <head> element to store <style> and <link> elements.
  • Use the CSS color property for text colors.
  • Use the CSS font-family property for text fonts.
  • Use the CSS font-size property for text sizes.
  • Use the CSS border property for visible element borders.
  • Use the CSS padding property for space inside the border.
  • Use the CSS margin property for space outside the border.