mardi 19 septembre 2017

CSS ignore parent elements of same the type

I need to add styles to an HTML code element that has duplicate parent elements of the same type.

Example: <code><code><code>foo</code></code></code>

I only want to apply styles to one of the elements, for example code { padding: 1px; } actually results in 3px in this example.

I have no control of this HTML as it is generated, it also can have only one parent code element sometimes.

Is it possible to write a CSS rule that ignores the parent elements and only targets the one?




Aucun commentaire:

Enregistrer un commentaire