css - :first-child with different class names -


i have html structure:

<div class="home-view">      <div class="view-header">header</div>      <div class="view-content">content</div> </div> 

and style first item of home-view. in case, it's view-header, there no header , view-content first item in home-view.

the first item in home-view should styles.

i've been trying .home-view:first-child, no luck there since it's children have different class-names (i think). advice?

.home-view > *:first-child { background-color:red; } 

...will select first sub element of type first child.


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -