Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS Selector :almost-empty?

I'm aware that the :empty pseudo-class will select all elements with no children, but I want to only select elements with text-nodes as children.

I have a bottom-border on my hyperlinks that're a different color than the text, but this is a problem because the hyperlinked images are also getting this underline.

I've tried a *:not(*){ border-bottom-width: 0; } in an attempt to fix this, but it didn't work. Is there a way to select a tags with only text-nodes for children?

like image 740
ITS Alaska Avatar asked Feb 26 '13 00:02

ITS Alaska


People also ask

How check if div is empty CSS?

The :empty selector matches every element that has no children (including text nodes).

What is CSS empty rule set?

The :empty CSS pseudo-class represents any element that has no children. Children can be either element nodes or text (including whitespace). Comments, processing instructions, and CSS content do not affect whether an element is considered empty.

What is active pseudo-class?

The :active CSS pseudo-class represents an element (such as a button) that is being activated by the user. When using a mouse, "activation" typically starts when the user presses down the primary mouse button.


1 Answers

If I understand your problem correctly, you are trying to keep your hyperlinked images from being underlined. If so, why not do something like: a img { text-decoration:none }?

Edit: If its the links on img tags you don't want underlined, apply a class to those links with text-decoration:none

like image 59
Matt Whitehead Avatar answered Nov 12 '22 01:11

Matt Whitehead