A CSS travesty
I have recently worked on a site that integrated with code from another agency and I found it deeply scary. I just wanted to ask if anyone else had ever come across this style of coding before. I just can't get my head around how anyone could think it was a good idea! It seems to completely miss the point of CSS and uses classes that mimic inline styles.
A small example:
<div class="float-left padding-top-5 padding-bottom-9 width-385">
<!-- Tip: Use the following heading IF you require a link. -->
<h3 class="section-heading">
<a href="..." class="link-333 padding-right-10"> Business</a>
<span class="double-chevron-right"> </span>
</h3>
<div class="float-left width-385">
<div class="float-left padding-top-5 padding-right-10 padding-bottom-10">
<a href='...'>
<img src="/...jpg" alt="..." width="70" height="70" border="0" /></a>
</div>
<!-- Tip: This must be on one line to prevent unwatned spacing in IE. -->
<div class="float-left width-286">
<h2 class="sub-heading-puff color-06c header padding-top-5">
..........etc
/******************* BORDERS *******************/28 February 2007
.border-top-d9d9d9 {
border-top:1px solid #d9d9d9;
}
.border-bottom-d9d9d9 {
border-bottom:1px solid #d9d9d9;
}
.border-right-d9d9d9 {
border-right:1px solid #d9d9d9;
}
.border-left-d9d9d9 {
border-left:1px solid #d9d9d9;
}
....... etc
/******************* SPACING *******************/
/*** Top ***/
.padding-top-1 {
padding-top:1px;
}
.padding-top-2 {
padding-top:2px;
}
.padding-top-3 {
padding-top:3px;
}
.padding-top-4 {
padding-top:4px;
}
.padding-top-5 {
padding-top:5px;
}
....... etc
.margin-right-4 {
margin-right:4px;
}
.margin-right-10 {
margin-right:10px;
}
.margin-right-15 {
margin-right:15px;
}
........ etc
/******************* WIDTHS *******************/
.width-25 {
width:25px;
}
.width-46 {
width:46px;
}
.width-65 {
width:65px;
}
.width-70 {
width:70px;
}
.width-80 {
width:80px;
}
............etc
Comments
I tracked down the guy who wrote this. Apparently the code went through a number of people and a number of changes after he created it. It's depressing but this does happen! 01 March 2007 from Debra
I highly recommend submitting this to The Daily WTF"... 03 March 2007 from Dominic Mitchell