How to style main with CSS? Or do I also need to add an identifier or class to ...">

HTML5 role = main as style

If i have

<div role="main"> </div> 

How to style main with CSS? Or do I also need to add an identifier or class to the <div> ?

+4
source share
1 answer

I would recommend adding an id or class. This is the most cross browser and efficient way.

If you cannot do this, you will need to use the attribute selector:

 div[role="main"] 
+11
source

All Articles