Browsing articles from "September, 2008"
Sep
15

Selecting elements with multiple classes

By Sam  //  Uncategorized  //  No Comments

Came across a problem today that meant I needed to select all elements that had two particular classes.

I needed to apply my styles to any element with class=”className className2″.  This is easily done by using:

className.className2{ styles }

Fortunately this was for an intranet project, as IE6 and lower do not support selecting like this. I believe they will only read the last part and apply the styles to className2.

Sep
10

Ordered list items all start with a 1

By Sam  //  Uncategorized  //  No Comments

Another odd one from IE 6 and 7.

Today I was having trouble with and ol (ordered list). First of all there were no numbers so I removed the float and they appeared. What did appear, however, was the number 1 repeated over and over. Every single li (list item) started with the number one.

After playing with it for at least half an hour I found that by removing the width I had set on the li they started to increment again. I did a bit of searching and came across the bug listed on Quirks Mode. Apparently, the same thing happens if you set a height.

Sponsored links