Thursday, November 1, 2018

HTML Structure and Tips

* HTML STRUCTURE

    For starters, a simple HTML structure is like this:

   There is also " THE <!DOCTYPE> DECLARATION"

It represents the document type declaration. It helps browsers to display web pages correctly but the codes you write will work without declaring the document type if you save them as HTML files.

Document type declaration for HTML5 is: 
           <!DOCTYPE html>

* TAGS IN HTML ARE CASE-INSENSITIVE. 
Which means that there is no difference between writing:
    <p>Hi</p>        and        <P>Hi</P>

* HOW TO START WRITING A HTML DOCUMENT:  

You can use Notepad ++ or other editors but a simple text document would do the job. 
Just add a text document to wherever you want in your computer.
Name your file whatever you want and change document extension to htm like this:

myName.htm

The first page in web pages often named as index because they often contain the index of the site.

SOME TIPS:

TIP 1:















This is a simple code that I have written. What it displays is this:

But when I organize the code a little it becomes like this:

Now it is easier to see which tags are under which tag and it is harder to forget a not closed tag.

TIP 2:

You can simply use Notepad for your code. But what I recommend is using an editor such as Notepad++ in order to get a more organized code and shortcuts:

Just open a document in Notepad++ and save as an HTML document. And it will give the colors and shortcuts for you.

TIP 3:

I recommend closing the tags right after opening one in order to deal with forgotten tags.







No comments:

Post a Comment