Skip to main content

Posts

Showing posts from March, 2014

CSS - Counter-increment and counter-reset

Today we will take a look at a couple of CSS properties that are usually used together but not very frequently used. We will be talking about the counter-increment and counter-reset properties. As the name suggests counter-increment and counter-reset definitely have something to do with counters. Let's take a look at the example below which will clearly illustrate the usage of these 2 properties. The implementation is very clear and straight-forward. The only question that remains now, can these CSS properties replace the ordered list (ol-li) HTML code? Do let me know your comments and feedback. Would you use these CSS properties against the standard ol-li structure?

CSS Text and Font

    In this post today, we will take a look at some of the most interesting CSS text and font properties listed below. text-transform white-space word-break word-spacing word-wrap font-variant Text-transform property:     Let's begin with the text-transform property. The filler text used in all the examples below has been taken from Andy Matthew's filler text generator which is a humorous replacement to the traditional boring lorem ipsum .     The text-transform property will turn your text to uppercase, lowercase and also will capitalize the first character of every word. So now you don't need any javascript to do your bidding. This transformation will be done irrespective of the special characters preceding and following the text characters. The following example will make things much more clear and editable of course =) White-space property:     The next property to explore is the white-space  property. The white-space CSS property

Difference between word-break: break-all versus word-wrap: break-word

    The 2 CSS properties  word-break: break-all  and  word-wrap: break-word  appear to work in the same way or generate the same output, but there is a slight difference between the 2 and we will be discussing these differences today.     Take a look at the example above. The difference is quite evident, however I will try to explain it further. word-break: break-all Irrespective of whether it’s a continuous word or many words, break-all breaks them up at the edge of the width limit even within the characters of the same word word-wrap: break-word This will wrap long words onto the next line. break-word adjusts different words so that they do not break in the middle.     So if you have many fixed-size spans which get content dynamically, you might just prefer using  word-wrap: break-word , as that way only the continuous words are broken in between, and in case it’s a sentence comprising many words, the spaces are adjusted to get intact words (no break within