View Full Version : Unordered List Icons i n Dreamweaver
mikehampen
11-09-2007, 04:49 PM
I would like to add different icons, such as star, or arrow, to the drop down menu for unordered lists in Dreamweaver. Is there a way to do this? Does anyone know of an extension that might help?
TORCH511
11-09-2007, 07:58 PM
You have a couple of options
The <UL> and <LI> will both take a couple of properties, namely the "Type", though your options are limited. You can choose Circle, Disc or Square
For other shapes then you are going to have to make your own bullet, and style the list with CSS, either inline, defined in the head or in an external style sheet. I will give an example of inline styling:
<ul style="list-style-image:url(../images/example.gif)">
<li>One</li>
<li>Two</li>
<li>Three</li>
</ul>
instead of ~..images/~, use the url to whatever image you will be using.
NOTE*** you can apply the style to the LI element as well as the UL element. If you style the UL element, then it will be applied to the entire list. Styling the LI element will only style that one item, so you can have a different image for every item in the list if you want.
There is a lot more you can do, a quick google search will turn up A LOT of information on this.
outsider
11-09-2007, 10:47 PM
I highly recommend to use background image for the list items. as list-type doesn't work in most cases.
here is an example: (this is an example for two level list item)
HTML
<ul class="my_list">
<li>list item one</li>
<li>list item two</li>
<li>list item three</li>
<li>list item four
<ul>
<li>list item four_one</li>
<li>list item four_two</li>
<li>list item four_three</li>
</ul>
</li>
</ul>
CSS file :
ul.my_list {
margin: 0;
padding: 0;
list-style: none; /* get rid out of dots etc. */
}
ul.my_list li { /* targeting the list items(LI) in the ul.my_list. Use your own graphic file as a list item graphic. */
background: url(images/your_graphic.png) left top no-repeat;
}
ul.my_list li ul li { /* This is for the second level list item. that should have a different graphic */
background: url(images/your_graphic_2.png) left top no-repeat;
}
by doing this, you will have your own list item graphics for both 1st and 2nd level list items.
If this is for navigation; its always good to shift sub level list items inwards:
ul.my_list li ul li {
background: url(images/your_graphic_2.png) left top no-repeat;
padding: 0 0 0 10px;
}
so the users can see that main navigation consists of :
list item one
list item two
list item three
list item four
list item_four_one
list item_four_two
list item_four_three
Let me know if there is any probs.
TORCH511
11-10-2007, 06:39 AM
Wow... not that using a background image and offsetting the list text is not a viable approach, but the CSS property list-style-image is supported by every browser except Netscape 4... I do not think you are going to find many people out there using netscape 4.
So a very long workaround to solve something that is not really a problem.
K.I.S.S. the less you have to type the better.
outsider
11-11-2007, 06:15 AM
I understand your point, the reason I prefer this metod as I found some issues on the IE6 when using list-style-image, can't remember exactly but say the UL element has no margin and padding and edging with the container, list item images was disappearing or they were overlapping with what is on the left of the container.
I even sometimes apply bg image straight in to the links (if they are navigational lists etc.) and display them as block level elements so that 'clickable' area is easier to ermm... click :)
Though it may seem a longer to apply this way, I guess I just used to it.
TORCH511
11-11-2007, 07:27 AM
You are spot on with the navigation and do it the same way when if and when I am using an <UL> element for navigation. However the margin/spacing issues with IE6 are numerous. I use an IE6 style sheet and just adjust margins/padding and a whole lot else from there.
I will be glad once we get to IE9 or 10... MAYBE then most of the browsers will act the same, until then it is a pain in the arse.
wildsue
11-12-2007, 06:48 AM
Hi mikehampen!
You got already a lot of tips for to style your list with images. If you'd like to give each item a special image you can do that. Give every li-element an id or a class (classes you can use more than once in a html-document) and then you can give each list-item in the css a special background-image.
Like that:
li.star {background-image: ......; and so on} every repeating style like no-repeat or background-position - if every image has the same size - and so on you can write like this:
li {background-repeat: no-repeat; .....}
Greetings from snowy Switzerland!
Susanne
vBulletin® v3.7.4, Copyright ©2000-2008, Jelsoft Enterprises Ltd.