开发者

CSS images next to links - more specific?

开发者 https://www.devze.com 2023-01-16 12:21 出处:网络
I am using something like this: .entry a { padding: 2px 0 0 8px; background: transparent url(images/link_arrow_light.gif) left top no-repeat;

I am using something like this:

.entry a {
  padding: 2px 0 0 8px;
  background: transparent url(images/link_arrow_light.gif) left top no-repeat;
  text-decoration: underline;
}

Which works fine but adds that image to all links (images, h3 tags, ...)

Is there a css way to have开发者_JAVA技巧 it only appear besides links that are within p-tags?


.entry p a {

This forces the <a>s to be a descendent of a <p> (while the <p>s must also be descent of some tags with the class entry.)

0

精彩评论

暂无评论...
验证码 换一张
取 消