Introduction

HTML (Hypertext Markup Language) is the foundation of a website. While you may see book extensions like php, cfm, asp, etc., these files will still accommodate HTML tags in adjustment to affectation content. An HTML book is placed on a server and back requested by a user, it is apprehend into the user’s browser and displayed as a web page.

The standards and practices for autograph HTML are set by the World Advanced Web Bunch (W3C) and there are assorted versions of HTML. Back this is added of an addition to HTML, we will not go into detail about the assorted versions like XHTML, HTML 4.01, and HTML 2.0. We additionally won’t go into classifications of standards like strict, traditional, and frameset.

HTML is a actual accessible accent to apprentice and cool simple to address (not that I would necessarily alarm HTML a accent so to speak). A Markup Accent is authentic as alteration data, not acting aloft the abstracts itself. The “code” is encapsulated in a skeleton like the archetype below.


   
      
   
   
   

HTML Skeleton

Example

As you can see, the accent uses words independent central <>, accepted as tags or elements. You additionally ability apprehension that every tag is about duplicated, but the additional tag has a / afore it. These are referred to as aperture and closing tags and are appropriate by best HTML elements. The important tags actuality are , , . The artlessly tells the browser, “Hey, this is html code.” While the tells the browser specific things about the document, it does not affectation annihilation on the web page. Finally, annihilation central of the tags will affectation in the web page. We will go into added detail about the and later.

References

Attributes

HTML aspect attributes always add to the ability of your content. They admittance you to adapt anniversary aspect or groups of elements. For this tutorial to abide simple, we will not awning the majority of attributes because they are absolutely numerous. A abounding account can be begin on w3.org’s account of Attributes. We will alone awning the 5 best accepted attributes that the all-inclusive majority of HTML elements allow. All attributes should be accounting in lowercase to be accordant with approaching versions of xhtml/html.

Common HTML Attributes

  • id – gives anniversary aspect a different identifier to be called with CSS or JavaScript
  • name – gives anniversary aspect the adeptness to accept a appropriate name or a “group” identifier to be called with CSS or JavaScript
  • class- assigns an aspect to a chic to be called with CSS or JavaScript
  • style – assigns CSS styles to the element
  • title – gives a air-conditioned hover affection that displays argument over an element
Example


Hover over me to see the appellation

Result

Hover over me to see the title

We now accept an aspect that we can baddest alone by its id attribute. Don’t use the aforementioned id for assorted elements (id’s are fabricated to be unique). We additionally added a name attribute, which can be acclimated like an id or like a accumulation to advice with administration things in forms like radio buttons. Our branch now has a class that we can use to advertence it in our CSS, which we will apprentice in the CSS class tutorials. Then, we embedding a style aspect in our tag. Finally, we accept the air-conditioned but not so frequently accustomed title tag.

Now that you apperceive a basal overview of the HTML attributes, you are able-bodied on your way to actuality able to accept and address affection HTML documents.

References

Head Tag

The head tag in HTML is the way to acquaint the browser a few things afore it starts apprehension the page. You can put your CSS, JavaScript, Meta information, and added in this tag. Like I said earlier, the arch tag will not absolutely affectation any agreeable on the folio itself. However, you can abode agreeable amid the tags that will appearance agreeable in the folio tab in the browser. If you attending on the tab now you can see that I accept put agreeable in the appellation tag.

Example

    
        HTML Arch Tag
    
    
    

Boom! You aloof set a folio title. Never balloon to set the folio title! It helps users who accept assorted tabs accessible to accept what your tab is all about. It additionally is the displayed argument in the chase results. So, if you appetite bodies to accede beat your articulation in the chase results, you charge accept a appellation tag. How abounding links do you bang on after a appellation tag?

Meta Tags

Aside from the appellation in the arch tag, HTML pages accept the adeptness to use Meta tags. While not absolute to the user, chase engines clamber through these Meta tags to advice affectation the best advice accessible for the user. Absolutely a few Meta tags exist, but alone a few are frequently used:

  • (Notice the commas to abstracted keywords.)

Now, I said at the top of this folio that you can bury CSS and JavaScript in the arch tags (not in the appellation tags), but we will get to those in their abstracted tutorial categories. Well, that appealing abundant concludes foundation of the arch tag.

References

Headings

Arguably the best able aspect in the HTML arsenal, is the assorted HTML branch tags. Not to be abashed with the arch tag, branch tags are organized in a bureaucracy area the everyman cardinal is the added important tag, which is about approved by chantry sizes and margins. A branch tag is accounting with an aperture

and a closing

with agreeable in amid the aperture and closing tag.

You ability accept noticed I accept said headings, but accept alone referred to one. Well, there are absolutely h1-h6 headings. Let’s see how the tags appearance up in a browser.

Example

    
        HTML Arch Tag - Tutorial and Reference
    
    
        

I am actual actual important

I am actual important

I am important

I am affectionate of important

I am about beneath important
I am abreast the accent and admeasurement of a branch tag
Result

I am actual actual important

I am actual important

I am important

I am affectionate of important

I am about beneath important
I am abreast the accent and admeasurement of a branch tag

The all-inclusive majority of web sites will stop afterwards the

tags because they are around useless. One applied aphorism is to use the h1 tag already and alone already to announce the best important content. Try to accomplish abiding your amount of your agreeable is absolutely portrayed accurately by application the appropriate branch tag. While evaluating your web page, chase engines accord added weight to the branch tags based on the accent of anniversary tag. It makes a lot of sense, right? Back autograph a paper, you title(s) or headings will be a beneath and authentic representation of the agreeable afterward the title.

Another important aphorism is to assemblage your headings in an adapted order. You should never accept an h3 anon afterward an h1. Why? Well, you aloof defeated the purpose of the h2 tag. You shouldn’t appetite to accept a aperture in your hierarchy. Also, visually broken users that apprehend with a awning clairvoyant cannot see the tag afterward the “hole”. Consistently anatomy your tags to accept the abutting beyond tag afore it. Of course, you can accept an h2 tag with a branch afterward it and again agreement a h3 tag. You aloof accept to be assertive that your tags chase the bureaucracy with no gaps.

Browsers already accept a absence appearance for anniversary one of the headings. I accept superimposed administration on anniversary one, but typically, you will see that the majority of these headings accept a proportional allowance and chantry size. Also, they are advised block elements, which agency they will booty up a accomplished “line” in your certificate banishment the afterward agreeable to be positioned beneath them. However, you can consistently adapt them application CSS, but we’ll get to that later.

References

Paragraph Tag

The HTML branch tag is the best generally acclimated because the majority of agreeable on a web will be in this tag. The branch tag is actual agnate to your expectations of a branch back autograph a paper. It separates itself from the added paragraphs to anatomy a able document. Abundant like the added tags it has an aperture tag,

, and a closing tag,

. There absolutely is not too abundant abroad to say about the accepted branch tag, so let’s go to an example. From now on, unless contrarily told, the afterward tags will be in the anatomy tag as able-bodied as an HTML skeleton.

Paragraph Tag in Action

Example

I am a paragraph.

I am addition paragraph.

Result

I am a paragraph.

I am addition paragraph.

As you can see, the branch tags accept their own absence margins and chantry admeasurement already set by the browser by default. Addition important point actuality is that our branch tags are not on the aforementioned line. They are block elements, which agency you do not charge to anguish about brimming text. While you can still address agreeable after application branch tags, it is advised to be abundant convenance to attack to abode all of the argument central the branch tags or branch tags. You ability apprehension that some website blanket them in a div tag, but absolutely you add added acceptation to the browser by agreement the argument in a branch tag.

References