Lists are used for many reasons within a web page. They can provide structure for web page link navigation, product lists and descriptions, song lists, article lists and basically any other type of list you might use for your web page design. It is very important to use the proper HTML format when constructing lists because of many reasons. First of all, search engines recognize list items as part of the hierarchy of significance. By placing important elements of your page within list item tags, you are easing search engines through your site more fluidly and more efficiently. Also, it is standard to structure HTML and CSS so that your content is functional. By this I mean that it is more comprehensive to have list items defined by list HTML markup, it creates structure within your page and the source is more readable. It also provides you with a more broad availability of CSS style options when you are attempting to change, edit or enhance the look and feel of your site.
A simple unordered list will look like this:
-
- List item 1
-
- List item 2
-
- List item 3
-
- List item 4
-
The
tag encloses the entire list, and marks the beginning of an unordered list.The tag encloses each individual list item.
Both of these tags can have a CSS style attached to it. They can also be defined by a specific div in case you want the first, last, or individual items to have different styles.
The list items, enclosed by the tag, automatically create bullets to the left of each item. While the bullets are present in any browser that views your list, the way in which these bullets are created differ between browsers.
Internet Explorer and Opera create this bullet using a left margin, while Safari and Firefox create the bullet using left padding. This is important to note, because if you plan on adding extra padding, margins, customized bullets, or background images within your list items, the browsers will handle the elements differently. A simple fix for your list bullet inconsistently is to take the margin and padding down to 0, take out the default bullets and make your own bullets using background images.
ul {
margin: 0px;
padding: 0px;
list-style-type: none;
}
li {
background: url(custombullet.gif) no-repeat 0 50%;
padding-left: 20px;
}
This CSS mark up works because it makes the image you choose as a background image within your element and positions it in the middle of the text and to the left of it. When creating your custom bullet, you should try and make it smaller than the text you are using, and also have it coincide with the rest of your site as far as color and design.
One of the most common purposes of a list is to provide structure for the navigation bars within your web page. A simple navigation bar using lists will look like this:
This list within your HTML document, provides you with three separate elements to work with within your CSS design.
-
-
-
All three of these elements can be style differently and creatively so that your list is unique to your site, simple and clean. Here is an example of list style design:
ul {
margin: 0px;
padding: 0px;
list-style-type: none;
}li {
background: url(custombullet.gif) no-repeat 0 50%;
padding-left: 20px;
font-family: verdana;
font-size: 11px;
font-weight: bold;
color: red;
}li a {
text-decoration: none;
color: red;
}
NOTE: By default all tags automatically make the text a bright blue color and underline it. This is because most links look this way within browsers, and it lets the user know that, "hey, here's a link." But, you will probably have your own idea of what you want links to look like, so it is essential that you set your "text-decoration" attribute to "none" so that you can decide how to custom design your links.
This is a very simple example of how to design an HTML list with your web page. Lists can perform all kind of functions in and of themselves by using simple CSS. I will be providing tutorials on CSS rollovers and creative use of background images in your list items.
Published by Nikki Freeman
Freelance Writer, Graphic Designer, Web Designer. My first passion was writing, my second Art, my third singing/songwriting/music/my guitar, fourth technology. Put them all together and somehow they manage t... View profile
- Biography of Li Na on ITF Circuit To put it mildly, when Li Na turned professional in 1999, she undeniably, dominated the ITF Circuit tour. Li won three of the very first four tournaments she entered and also won the first seven ITF doubles tournament...
- Fearless : Jet-Li Brings Back His Chinese Heritage A new film from Jet Li that takes him back to his roots. Exactly the kind of Jet Li we've been waiting for...
-
Unleashed: Movie Stars Jet Li and Morgan Freeman
A review about the 2004 movie Unleashed starring Jet Li, Morgan Freeman. It is Jet Li's best martial arts movie yet. It is brutal, and violent, yet takes a turn that showcases i...
- Jackie Chan and Jet Li Team Up for the First Time Martial Arts movie stars Jackie Chan and Jet Li are teaming up for the first time in 'The Forbidden Kingdom," a new action film that will begin production next month in China.
-
Jackie Chan and Jet Li to Team Up on Film
Jackie Chan and Jet Li team up for "The Forbidden Kingdom"
- Web Design Tutorial: Creating Simple CSS Rollovers
- First Look: Jet Li and Jackie Chan in The Forbidden Kingdom
- Inspirational Woman: Alice Li, Executive for Lenovo
- Jet Li and Aaliyah in "Romeo Must Die"
- Street Fighter: The Legend of Chun-Li, No Thanks!
- Lykke Li - Youth Novels
- Jet Li & Jackie Chan - the Art of Age
|
|
- Review: Soulo converts iPad into karaoke machine (AP)
- Lawsuit seeks to block Google's privacy changes (AP)
- Lenovo 3Q profit up by half, warns of disk supply (AP)
- Just Show Me: How to check your data usage on Android 4.0 (Yahoo! News)
- Far-out footage: Water droplets orbit a knitting needle on the International Space Station (Yahoo! News)
- HTML Lists give you more CSS style options
- Lists can be used for web page link navigation, product lists and descriptions, song lists. and more
- Lists can perform all kind of functions in and of themselves by using simple CSS
1 Comments
Post a CommentCSS "Cascading Style Sheets" Lessons
css list style Properties and examples -- http://css-lessons.ucoz.com/list-css-examples.htm