Log in

View Full Version : Logo help



Marcus-Hill
04-03-2008, 06:34 PM
Hi,

Not sure if this is the right place to post this question but I'll give it a go. I'm trying to find out how I include a small logo in front of the URL but can't find how I do it. Can anyone help me out with the code?

boogyman
04-03-2008, 06:58 PM
in front as in to the left side or in front as in directly over the text

you can do both with css. the former can be done with a background image, while the latter requires an additional image tag



<ul id="menu">
<li>Some Link</li>
<li>Some Other Link</li>
<li>Boring Link</li>
</ul>



ul#menu li {
/* reset defaults */
list-style-type: none;
margin: 0;
padding: 0;
/* apply left-aligned logo */
padding-left: 1em;
background: url('/path/to/image.jpg') no-repeat top left;
}

that will apply the same image to all of the list items, to get a separate image per list item, you can use almost the same code, with a few minor updates



<ul id="menu">
<li id="link1">Some Link</li>
<li id="link2">Some Other Link</li>
<li id="link3">Boring Link</li>
</ul>



ul#menu li {
/* reset defaults */
list-style-type: none;
margin: 0;
padding: 0;
/* apply left-aligned logo */
padding-left: 1em;
}
ul#menu li#link1 {background: url('/path/to/image1.jpg') no-repeat top left;}
ul#menu li#link2 {background: url('/path/to/image2.jpg') no-repeat top left;}
ul#menu li#link3 {background: url('/path/to/image3.jpg') no-repeat top left;}

note that I still kept the padding in the original declaration... it will be inherited to all the list items still... the only thing that is different is that you want each list item to have its own unique image.

you can do this same process with "groups" of links too... just replace id with class (html) and # with . (css) respectively

Marcus-Hill
04-03-2008, 07:23 PM
If you look at the address bar of your browser now, can you see the green 'd' logo that dynamic drive has there and in the browser tab (I-Explorer)?
I want to put my little logo there.

I didn't make much sense of what you wrote, can you explain it in slightly simpler terms for me?

Much appreciated!

thetestingsite
04-03-2008, 07:33 PM
That is a favicon. DD has a tool for making these located here:
http://tools.dynamicdrive.com/favicon/

Hope this helps.

Marcus-Hill
04-03-2008, 10:29 PM
Thetestingsite, once again you are a legend.

Many thanks!