Posts

Classes in HTML

Image
Classes:The class attribute is used to point a class in a style sheet.It specifies one or more class names for an element.It is used to set the same styles to different elements with same class name.



 If we write this code, the page appears to be...






Creating lists

Image
Lists:    Lists are commonly used to display the items one after the other instead of using <br> tags.They are of two types-

Unordered listsOrdered listsUnordered lists:Unordered lists are used when a set of items can be placed in any order. These lists use a pair of <ul> tags and each element in the list use pair of <li> tags.



 If we write this code, the page appears to be...



    We can change the type of bullet i.e.,square, circle etc. by using type attribute in <ul> tag.

 If we write this code, the page appears to be...



Ordered lists:Ordered lists are used when a set of items that need to be placed in a specific order. These lists use a pair of <ol> tags and each element in the list use pair of <li> tags.
 If we write this code, the page appears to be...



    We can specify thetype of numbering i.e., I, i, 1, a, A by usingtypeattribute in <ol> tag.


 If we write this code, the page appears to be...




    We can even specify the starting number of the li…

Adding images

Image
Images:    The images are defined with <img> tags.This tag does not have a closing tag.                              <img src="url" alt="text">


If we write this code, the page appears to be...


    Here src attribute specifies the address of the image and the alt attribute is used as an alternative.If the user cannot view the image of some reason, this attribute provides an alternative text for that image and that text will be displayed on the frame. Image Height and Width:
   We can use the style attribute to set both the height and width of an image. 


                  If we write this code, the page appears to be...





   We can also do that by using individual height and width attributes.



If we write this code, the page appears to be...





Image borders:    Adding borders to images is done by using attributes like border_width, border_color and border_style in the style attribute.





HTML links

Image
Links:    Links allows us to link our documents to any other document we want to, we can also link to specific parts of documents and can make apps available at a simple web.
In HTML links are defined with <a> tag.It appears to be-
<a href="url">link text</a>
The href specifies the destination of the link. The link text is the visible part.


If we write this code, the page appears to be...




Link colors:    By default,the link appears to be-

Every link is underlined.If the link is unvisited  it is blue.If the link is visited  it is purple.If the link is active  it is red.    By using style,we can even change them




If we write this code, the page appears to be...



    We can set the colors of the links using alink for active links and vlink for visited links of <body> tag.


If we write this code, the page appears to be...


Target attribute:    By using the target attribute,we can set the location where to open the linked document.It can have any one of the following- _b…

Adding comments in HTML

Image
Comments:    Comments are a part of code that helps the coder and the user to know what is what, to indicate the sections of a document and improves the readability of the document.
    HTML comments are placed between <!--...............--> tags.Comments are not displayed and are completely ignored by the browser. HTML also supports multi-line comments.

 If we write this code, the page appears to be...




Create tables using HTML

Image
Tables:    A HTML table are created using <table> tag.    A table row is created using <tr> tag.    A table header is created using <th> tag.    A table data is created using the <td> tag.

If we write this code, the page appears to be...

Cell padding and cell spacing attributes:  There are two attributes called cell padding and cell spacing which you will use to         adjust the white space in your table cells. Cell padding:   Cell padding sets the space between the contents of the and its borders. If you do not specify a padding, the table cells will be displayed without padding.

If we write this code, the page appears to be...





Cell spacing:  The cell spacing attribute defines the width of the border.
If we write this code, the page appears to be...
Colspan attribute:
If we write this code, the page appears to be...
You will use colspan attribute if you want to merge two or more columns into a single column. Rowspan attribute: You will use rowspan attri

Paragraphs and Headings

Image
Paragraphs:
    The <p> tag defines a paragraph.


    If we write this code, the page appears to be...


Headings:

     The <h1> to <h6> tags define the headings.


    If we write this code, the page appears to be...