Wednesday, 15 April 2015

2-level nested CSS selector -



2-level nested CSS selector -

i know can in css:

div.classname p { /* style*/ }

but how can do

div.classname p span { /* style */ }

to refer span in html this:

<div class='classname'> <p> <span> text </span> </p> </div>

there's technically nil wrong selector. recommend not including tag name when isn't necessary though, described google html/css style guide.

it's easy grip on how selectors work inspecting elements chrome's inspector. total selector path provided, this:

css selector

No comments:

Post a Comment