laggingreflex laggingreflex - 6 months ago 25
CSS Question

How to style CSS role

In the following HTML

<div id="content" role="main">


the id can be accessed through
#content
in CSS. How do I access
role="main"
.

Answer

Use CSS attribute selectors:

https://developer.mozilla.org/en-US/docs/CSS/Attribute_selectors

e.g.:

div[role=main]
Comments