HTML INCLUDE

What is HTML Attribute

HTML Attribute adds additional information to an element, they are always placed in the opening tag and every element can have a tag. Attributes are usually have a name and a value, for instance name="value".

source(src) Attribute

This attribute is used to embed images in a HTML page. it is denoted as <img src> for images. src attribute specifies the path from which the image is dislayed from.

Example

  •       
       
      <!DOCTYPE html >
      < html  >    
      <head >     
      >title>src >/title >
      </head> 
      < body> 
    
      <img src="../../img/moonshine.jpg">
      < /body> 
      <  /html>
    
      
      

    The <img> element also makes use of width and height attributes to define the size of an imge(in pixcels)

    examples

  •   
        
      <!DOCTYPE html >
      < html  >    
      <head >     
      >title>src >/title >
      </head> 
      < body> 
    
      <img src="moonshine.jpg" width="600px" height="100px">
    
      < /body> 
      <  /html>
      
      

    Another attribute images uses is the alt attribute, this is to give an image an alternative text.

  •   
      
      <!DOCTYPE html >
      < html  >    
      <head >     
      <title>src   </title >
      </head> 
      < body>   
      <img src="moonshine.jpg" alt="nightsky">
      < /body> 
      <  /html>
      
      

    the style attribute

    this attribute is used to add styles to an element such as color, font, text-style etc.

  •   
                     
      <p style="color:red;">
      the greatest show, by the greatest show man for the greastest people.
      </p>
       
      

    More information in HTML STYLE

    lang Attribute

    This attribute is added to the element, it is used to declare the language of the web page, it helps the sreach engine or broswer specify the language.

  •   
        
      <!doctype html>
      <html lang="en">
      <head>
      </head>
      <body>
      <p style="color:red;">
      the greatest show, by the greatest show man for the greastest people.
      </p>
      </body>
      </html lang="en">
          
      

    NOTE: Although HTML does not require lowercase for attributes(lang and LANG) are the same but we advice you make use of lowercase so you dont find it difficult to adjust when using strict documenttype like XHTML.

    single and double quotes

    the values attached to every attribute should be quoted, in a case where the value it self has a single quote, it should then be quoted with double quote and the same goes for the double

  •   
        
    
      <p title="moving forward"> correct
      <p title=moving forward> wrong
      <p title="moving 'forward' towards light"> correct
      <p title="moving "forward" towards light"> wrong
      <p title='moving "forward" towards light'> correct
      <p title='moving 'forward' towards light'> wrong
          
      

    Dess App

    DessApp is an Integrated E-learning Education, Interactive and User-friendly features, smarter options and redefining your school costs effectively and efficiently.

    View
    1 1