Forum Moderators: not2easy

Message Too Old, No Replies

Epic CSS Fails Of My Past

         

Planet13

11:21 pm on Dec 24, 2014 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I was "cleaning up" some CSS from some sites I worked on before I had any real grasp of CSS, and I came across this little gem of code that I had written.

#big-div {
padding-top: 4px;
padding-right: 6px;
padding-bottom:8px;
padding-left: 6px;
padding-right:4px;
]

#big-div {padding: 6px 7px 5px 8px;}


What was I thinking? Guess the padding on the right side was giving me problems, hence the need to declare it three different times...

Hopefully others have had such... um... "inspired moments of coding" and can post them here, too.

lucy24

1:36 am on Dec 25, 2014 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



hence the need to declare it three different times...

With a different value each time, while the well-behaved other three sides only required two values. Seriously, I think there do exist browsers that give higher precedence to an explicit "padding-right" (or "margin-right" or what-have-you) than to a right padding that's declared as part of a single 1-to-4-item list.

We will not talk about how long I continued using <hx> levels for format before I forced myself to cut it out. (Picture the title page of an old-fashioned book with a couple dozen lines of print, each in a different size. Now label them <h1> through <h6> based purely on presentation.) To ease the transition I called the new presentational classes "one" through "six" to match my personal settings for h1 through h6. So <h3 class = "five"> was a semantic h3 that looked like a default h5.

not2easy

1:59 am on Dec 25, 2014 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Huh, I thought I was the only one using styled <hx> tags in context never intended. I keep finding out it was fairly common.

Planet13

2:30 am on Dec 25, 2014 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



With a different value each time, while the well-behaved other three sides only required two values.


Well, I guess I figured that CSS would average them out or something...