You are here: Re: add an image to a link with CSS - possible? « HTML « IT news, forums, messages
Re: add an image to a link with CSS - possible?

Posted by Tomasz Chmielewski on 11/26/07 16:22

Jonathan N. Little schrieb:
> Tomasz Chmielewski wrote:
>> Tomasz Chmielewski schrieb:
>>
>> (...)
>>
>>>> To OP though, my background image method will work in IE, the
>>>> generated content methods will not.
>>
>>> How should my CSS look like? I'm trying to achieve it for some time
>>> now, with no success.
>
> Well firstly you was want to use CLASS not ID. With ID you can only have
> 2 links per page "normal" and "arrows" because all IDs must be unique.
> So use CLASS.
>
>>
>> So, this is almost the one I was looking for:
>>
>> #arrows a {
>
> This is incorrect anyway, this means an A element *within* another
> element with an ID of "arrows".

So, below an A element is within a DIV element with an ID of arrows,
isn't it?

<div id="normal">
<a href="normal.html">Normal link</a>
</div>
<div id="arrows">
<a href="subpage.html">Link with an arrow image</a>
</div>


> Should should been: a#arrows {...}

If I set it this way, it doesn't work (for id, at least, I didn't check
with class).



> a.arrows{
> padding-right: 20px;
> background: url(arrow.png) no-repeat center right;
> }
>
> <div class="arrows">
> <a href="subpage.html">Link with an arrow image</a>
> </div>

But I want to use id (I parse some elements with JavaScript).


--
Tomasz Chmielewski
http://wpkg.org

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация