Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS Selector Style

Simple question, and probably reflects my inexperience with CSS, but...

When creating a style sheet I like to explicitly specify the '*' wild card, so:

*.TitleText {

instead of just

.TitleText {

I find it reminds me that TitleText is applied to "any" tag, and can be overridden by a subsequent h1.TitleText. Maybe I just like this because for the longest time I didn't get that whole CSS selector concept properly and when I realized that the second (above) was just shorthand for the first, a lot of things "clicked".

Is what I do bad practice, good practice, or neither here nor there?

like image 261
Lawrence Dol Avatar asked Feb 05 '26 09:02

Lawrence Dol


1 Answers

I don't know whether it's good or bad, but I've been doing CSS work as part of web app development for several years and I've never seen anyone use the * character.

like image 82
ahockley Avatar answered Feb 08 '26 06:02

ahockley