html - Apply styles for several class which ends at a number -


i have doubt this. possible apply styles several classes between interval of number? instance, have several divs class "content1", "content2", "content3", etc. in normal case, perhaps do:

.content1, content2, content3{   font-size: 1em; } 

or:

div[class^="content"]{   font-size: 1em; } 

but posibble this?

div.content:nth-child(1-6){   font-size: 1em; }     

indeed, it is.

use nth-of-type

div[class^="content"]:nth-of-type(n+2):nth-of-type(-n+6){    font-size: 1em; }     

working jsfiddle


Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -