LearnHTML



HTML

  • HTML -HyperText Markup Language

  •  HTML is Not An Programming Language It's An Standard Markup Language For   Documents Designed to be displayed in a Web Browser

  •  It Contains Skelton and It Describes the Structure of the Web Page 
  • HTML consists of a series of elements
  • HTML elements tell the browser how to display the content 
  • HTML elements label pieces of content such as "this is a heading", "this is a paragraph", "this is a link", etc. 

       TAGS:

             <  Open Tag

             >  Close Tag

       Basic Syntax:

       
        <!DOCTYPE html>

        <html>
        <head>
        <title>Page Title</title>
        </head>
        <body>
        <h1>Heading Tag</h1>
        <p> Paragraph Tag</p>
        </body>
        </html>

  • The <!DOCTYPE html> declaration defines that this document is an HTML5 document
  • The <html> element is the root element of an HTML page
  • The <head> element contains Header-information about the HTML page
  • The <title> element specifies a title for the HTML page (which is shown in the browser's title bar or in the page's tab)
  • The <body> element defines the document's body and is a container for all the visible contents, such as headings, paragraphs, images, hyperlinks, tables, lists, etc.
  • The <h1> element defines a large heading
  • The <p> element defines a paragraph
   HTML DOCUMENTS:
  •  All HTML documents must start with a document type declaration: <!DOCTYPE html>.
  •  The HTML document itself begins with <html> and ends with </html>.
  •  The visible part of the HTML document is between <body> and </body>.
        EX:
            <!DOCTYPE html><html>
            <body>
            <h1>First Heading</h1>
            <p> First paragraph.</p>
            </body>
            </html>
  •  The <!DOCTYPE> declaration represents the document type
  •   helps browsers display web pages correctly.
  •   It must only appear once, at the top of the page
  •   The <!DOCTYPE> declaration is not case-sensitive.
DECLARATION OF HTML5:
            <!DOCTYPE html>

HTML HEADINGS:
  •    HTML Heading Tags Are Defined With <h1> to <h6> Tags.
HTML PARAGRAPHS:
  •     Paragraph Tag Defines With <p> Tag.
       EX:
            
            <p> WELCOME YOU ALL</p>

HTML LINKS:
  •    It's Specified with the "href" attribute 
      href  -  hypertext reference
        
        EX:
            <a href="www.google.com">Google</a>

HTML IMAGES:
  •   Images are Defined With <img> tag it Refers Image  
      EX:

        <img src="google.jpg" alt="google.com" width=105px height=60px>
Here,
    src  - source
    img - image
    alt   - alternative text

HTML HEADINGS:
      

Heading 1---<h1>

Heading 2 --- <h2>

Heading 3 --- <h3>

Heading 4 --- <h4>

Heading 5 --- <h5>
Heading 6 --- <h6>

HTML HORIZONTAL:
    The <hr> element is used to separate content in an HTML page
   EX: 
<h1> heading 1</h1>
<p>Paragraph</p>
<hr>
<h2> heading 2</h2>
<p>Paragraph</p>
<hr>

HTML BREAKS:
 <br> element defines a line break.

  Use <br> if you want a line break (a new line) without starting a new paragraph

EX:

<p>This is<br>a paragraph<br>with line breaks.</p>


HTML PREFORMATTED TEXT:

    The HTML <pre> element defines preformatted text.

    The text inside an <pre> element is displayed in a fixed-width font (usually                 Courier), and it preserves both spaces and line breaks:

<pre>
  My Bonnie lies over the ocean.

  My Bonnie lies over the sea.

  My Bonnie lies over the ocean.

  Oh, bring back my Bonnie to me.
</pre>

HTML STYLES:

The HTML style attribute is used to add styles to an element, such as color, font, size, and more.

HTML TEXT COLOR:

The CSS color property defines the text color for an HTML element

EX:

<h1 style="color:blue;">This is  heading</h1>
<p style="color:red;">This is  paragraph.</p>

HTML FONTS:

The CSS font-family property defines the font to be used for an HTML element

EX:

<h1 style="font-family: Verdana;">This is  heading</h1>
<p style="font-family:courier;">This is  paragraph.</p>

HTML TEXT SIZE:

The CSS font-size property defines the text size for an HTML element

EX:

<h1 style="font-size:300%;">This is  heading</h1>
<p style="font-size:160%;">This is  paragraph.</p>

HTML TEXT ALIGNMENT:

The CSS text-align property defines the horizontal text alignment for an HTML element

EX:

<h1 style="text-align:center;">Centered Heading</h1>
<p style="text-align:center;">Centered paragraph.</p>

HTML TEXT FORMATTING:

  • <b> - Bold text
  • <strong> - Important text
  • <i> - Italic text
  • <em> - Emphasized text
  • <mark> - Marked text
  • <small> - Smaller text
  • <del> - Deleted text
  • <ins> - Inserted text
  • <sub> - Subscript text
  • <sup> - Superscript text
<b>and<strong>
    
    The HTML <b> element defines bold text, without any extra importance.
    The HTML <strong> element defines text with strong importance. The content inside is typically displayed in bold.
 
EX:

    <b>This text is bold</b>

  <strong>This text is important!</strong>

<i>and<em>

    The HTML <i> element defines a part of a text in an alternate voice or mood. The content inside is typically displayed in italic.
    The HTML <em> element defines emphasized text. The content inside is typically displayed in italic.

EX:
    
    <i>This text is italic</i>

  <em>This text is emphasized</em>


<small>

    The HTML <small> element defines smaller text

EX:

    <small>This is some smaller text.</small>

<mark>

    The HTML <mark> element defines the text that should be marked or highlighted

EX:

    <p>Do not forget to buy <mark>milk</mark> today.</p>

<del>

    The HTML <del> element defines text that has been deleted from a document. Browsers will usually strike a line through deleted text

EX:
    <p>My favorite color is <del>blue</del> red.</p>

<ins>
    
    The HTML <ins> element defines a text that has been inserted into a document. Browsers will usually underline inserted text

EX:
    <p>My favorite color is <del>blue</del> <ins>red</ins>.</p>

<sub>and<sup>

    The HTML <sub> element defines subscript text. Subscript text appears half a character below the normal line and is sometimes rendered in a smaller font. Subscript text can be used for chemical formulas, like H2O

       The HTML <sup> element defines superscript text. Superscript text appears half a character above the normal line and is sometimes rendered in a smaller font. Superscript text can be used for footnotes, like WWW[1]

EX:

    <p>This is <sub>subscripted</sub> text.</p>

  <p>This is <sup>superscripted</sup> text.</p>


 

HTML QUOTATION AND CITATION ELEMENTS :


    HTML <blockquote> :

        The HTML <blockquote> element defines a section that is quoted from another source.

Browsers usually indent <blockquote> elements

EX:

    <p>Here is a quote from WWF's website:</p>

<blockquote cite="http://www.worldwildlife.org/who/index.html">
For 60 years, WWF has worked to help people and nature thrive. WWF is the world's leading conservation organization in nearly 100 countries. At every level, we collaborate with people around the world to develop and deliver innovative solutions that protect communities, wildlife, and the places in which they live.
</blockquote>

    HTML <q> :
        
        The HTML <q> tag defines a short quotation.

Browsers normally insert quotation marks around the quotation.

EX:

    <p>WWF's goal is to: <q>Build a future where people live in harmony with nature.</q></p>

       HTML <abbr> :

           The HTML <abbr> tag defines an abbreviation or an acronym, like "HTML", "CSS", "Mr.", "Dr.", "ASAP", "ATM".

Marking abbreviations can give useful information to browsers, translation systems, and search engines.

EX:

    <p>The <abbr title="World Health Organization">WHO</abbr> was founded in 1948.</p>

      HTML <address> :

        The HTML <address> tag defines the contact information for the author/owner of a document or an article.

The contact information can be an email address, URL, physical address, phone number, social media handle, etc.

The text in the <address> element usually renders in italics, and browsers will always add a line break before and after the <address> element.

EX:

    <address>

Written by John Doe.<br>
Visit us at:<br>
Example. com<br>
Box 564, Disneyland<br>
USA
</address>

      HTML <cite> :
        
        The HTML <cite> tag defines the title of a creative work (e.g. a book, a poem, a song, a movie, a painting, a sculpture, etc.).

            The text in the <cite> element usually renders in italics.

EX:

    <p><cite>The Scream</cite> by Edvard Munch. Painted in 1893.</p>

        HTML <bdo> :
            
            BDO stands for Bi-Directional Override.

The HTML <bdo> tag is used to override the current text direction

EX:

    <bdo dir="rtl">This text will be written from right to left</bdo>

HTML COMMENTS:

    HTML comments are not displayed in the browser, but they can help document your HTML source code.

        HTML COMMENTS TAG:

                <!-- This is a comment -->

        <p>This is a paragraph.</p>

        <!-- Remember to add more information here -->

        HIDE CONTENT:

                <p>This is a paragraph.</p>

        <!-- <p>This is another paragraph </p> -->

        <p>This is a paragraph too.</p>

You can also hide more than one line. Everything between the <!-- and the --> will be hidden from the display

        <p>This is a paragraph.</p>
    <!--
    <p>Look at this cool image:</p>
    <img border="0" src="pic_trulli.jpg" alt="Trulli">
    -->

    <p>This is a paragraph too.</p>

    

   HIDE LINE CONTENT:

              Comments can be used to hide parts in the middle of the HTML code.
            
             <p>This <!-- great text --> is a paragraph.</p>

Post a Comment

Previous Post Next Post