Quantcast
Channel: professional website design » CSS3
Viewing all articles
Browse latest Browse all 198

Quantity Ordering With CSS

$
0
0
Here is your mission, should you choose to accept it: create a table of items . Each item should span a third of the content area, with the fourth item starting on a new row, much like floats. However, a particular item must always display the price at the end of the first row. So if there are only two elements, the price element would be second. But if there are more than three items, the price would be the last element in the first row. You might assume that JavaScript would be the best solution — just loop over the items, and if there are more than three, update the styling. But what if I told you could do it with CSS alone? Pure CSS Counting I’ve gone all in on flexbox lately, teaching it right alongside floats as a layout method at our little project called HackerYou , and I have found that students take to it well

Viewing all articles
Browse latest Browse all 198

Trending Articles