CSS Tip: Avoid applying positioning at element level
By Chris on Jan 8, 2007 | In CSS | Send feedback »
Here's a little CSS tip: Don't apply positioning rules (including alignment, margins, floats, etc) to a base element, for there will surely come a day when you say, "But I don't want <label> elements to float left on this page!" Instead, use a rule based on a class or id. You may find that every single instance of said element now has the same class attribute, but it will make life much easier in the long run.
The Bad
label {
position: absolute;
}
The Good:
.label_abs {
position: absolute;
}
Trackback address for this post
No feedback yet
Leave a comment
| « When fate gives you a latte, you take the latte | Spore: This is the game that never ends, yes it goes on and on my friends... » |