how to create styles for a progressive ID?

0

How can I create styles for ids that are differentiated at the end by a number? I had seen something like this "#1, #2 = id(+n)" , but it did not work for me

    
asked by Andres Beltrán 08.04.2017 в 23:01
source

2 answers

3

If all the elements have the same CSS rules, you only need to use a wildcard:

div[id^="ejemplo"]

The above is translated to: "Apply these styles to every div that has an id that starts with" example. "In this way, you can have identifiers of type ejemploN and all will be affected, however, I recommend use classes instead.

    
answered by 28.04.2017 / 14:39
source
0

I do not know anything like that (I do not want to tell you that it does not exist because I do not know the memory standard). The usual thing is to add a common class to all the elements that have that sequential id and use it as a selector.

    
answered by 08.04.2017 в 23:28