Web Hosting Talk







View Full Version : css


furqan_sindhu
03-08-2006, 07:10 AM
how to display an image left to a link using css ?

any one can tell me pls???

the_pm
03-08-2006, 10:23 AM
<img src="imagename.jpg" alt="Alt Text" /><a href="gosomewhere.html">Link text</a>

You just put them in order, and voila, the image is on the left side of the link :)

I take it there's more you're looking to do than just this? If you posted a link to an example, or describe it in more detail, it'll be easier to ensure you get the answer you're looking for. Or maybe that al you needed ^^ :)

furqan_sindhu
03-08-2006, 11:28 AM
ohhhhhhhh ! thats reaklly made me laugh !

that was not what i was looking for :(

i want to associate an image with the link , such that whenever a new link is added, i dont have to worry about the image to display it manually.

actually what i know is that css seperates out the data from presentation. so, image display is just a presentation part, and i want to associate an image whenever a new link gets added , automatically


any ideaaaaaaaaaaaaaa ??????

the_pm
03-08-2006, 11:37 AM
In your CSS:

a.nav { background:url(image.ext) left center no-repeat ; padding-left:XXpx }

Change the number of pixels to accommodate the image you want to show.

In your HTML document:

<a href="wherever.html" class="nav">Link Text</a>

Still, this may be a little too general, because the method you'll want to use will need to be tweaked depending on the layout.

furqan_sindhu
03-09-2006, 04:01 AM
thats really cool and simple idea, i will try that when i get back to my personal coimputer, thanks a lot

thanks a lot agaiiiiiiiiiiiiiiiiiiiiiiiinnnnnnnnnn