CSS - Common Classes

In my web application, I use several CSS classes to write less code. I often use them in markup to add one property or two in some cases.

These are the following

.clear { float: none; clear: both; }
.fl_l{ float: left; }
.fl_r{ float: right; }
.ta_l{ text-align: left; }
.ta_r{ text-align: right; }
.no_td:hover { text-decoration: none; }

What similar classes do you use? Have you ever seen this technique in other projects?

+5
source share
5 answers

Yes, if you don’t use common classes like you, your CSS files become extremely large and each class becomes extremely specific

some other common classes ...

.split { float: left; width: 50%; }
.center { text-align: center: margin: auto; display: block; }
.bold { font-weight: bold; }
.top { vertical-align: top; }
.bottom { vertical-align: bottom; }
+3
source

, , , . , . , CSS - . , , style html , , . , , HTML, .

, HTML (, , ):

<p class="abstract ta_l mb10">
    Lorem ipsum dolor set.
</p>

, : , , " : " ( , mb10 ... ' , ), HTML.

10 , . , 50? , ? .

CSS , . "" , .

, HTML:

<p class="abstract">
    You should sign in or something!
</p>

CSS:

.abstract {
   margin-bottom: 10px;
   text-align: left;
}

:

.abstract {
  text-align: right;
  margin-bottom: 0;
}

! 50 !

2 - -, .

+4

:

.clearfix:after 
{
    clear:both;
    content:".";
    display:block;
    height:0;
    line-height:0;
    visibility:hidden;
}
+2

, . , base.css, . Eric Meyers css reset, .

, , CSS-, , , :

960 grid css framework

cssprint

+2

, , , HTML. , , , .

float ( , ), - . ( , , , ). .

, , , . , , , - , , , . , HTML , .

+2

All Articles