Showing posts with label HTML. Show all posts
Showing posts with label HTML. Show all posts

Wednesday 4 December 2013

CSS : FLOATING LIST ITEMS


Floating List Items

In the example above the links have different widths.
For all the links to have an equal width, float the <li> elements and specify a width for the <a> elements:


Example

li
{
float:left;
}
a
{
display:block;
width:60px;
}

Example explained:
  • float:left - use float to get block elements to slide next to each other
  • display:block - Displaying the links as block elements makes the whole link area clickable (not just the text), and it allows us to specify the width
  • width:60px - Since block elements take up the full width available, they cannot float next to each other.   
                     Other Topics


CSS : MEDIA,CSS::STYLING FORMS, mechanical Engineering, English books,Photoshop tutorials,Harry potter,Best 100 english books,Mechanical-old-question-paper,STYLE HTML ELEMENTS WITH SPECIFIC ATTRIBUTES,CSS : HORIZONTAL NAVIGATION BAR,CSS : FLOATING LIST ITEMS,CSS : IMAGE GALLERY,CSS : NAVIGATION BARS,CSS : VERTICAL NAVIGATION BAR,CSS : LIST OF CSS PSEUDO CLASSES
  •  

CSS : HORIZONTAL NAVIGATION BAR


Horizontal Navigation Bar

There are two ways to create a horizontal navigation bar. Using inline or floating list items.
Both methods work fine, but if you want the links to be the same size, you have to use the floating method.

Inline List Items

One way to build a horizontal navigation bar is to specify the <li> elements as inline, in addition to the "standard" code above:

Example

li
{
display:inline;
}
Example explained:

Physics basic inventions and inventors

1.Which instrument is used to measure altitudes in aircraft's ? Audiometer Ammeter Altimeter Anemometer Explanation : ...