Search
 
SCRIPT & CODE EXAMPLE
 

CSS

how to alternate background colour in html div elements in css

/* to color odd children in parent-container with children of type div */
#parent-container > div:nth-child(odd) {
 background-color:red;
}

/* to color even children in parent-container with children of type div */
#parent-container > div:nth-child(even) {
 background-color:red;
}
Comment

PREVIOUS NEXT
Code Example
Css :: css font arial 
Css :: get rid of arrows number input 
Css :: how to blur background color in css 
Css :: css media queries 
Css :: stop text from wrapping 
Css :: overflow dots css 
Css :: css center everything 
Css :: disable click css 
Css :: increase the size of an image on hover using css 
Css :: darken image css 
Css :: apple font css 
Css :: how to remove markers in css 
Css :: css text vertical direction 
Css :: new line in url 
Css :: z-index max value 
Css :: input form shadow active bootstrap 
Css :: square bullets css 
Css :: place item center in css using grid 
Css :: css image round 
Css :: button mouse icon hover css 
Css :: striped tables css 
Css :: css list no bullets 
Css :: how to put element in center in html 
Css :: How to make an image fill its container without stretching 
Css :: mixin for transition css 
Css :: button on top right corner css 
Css :: css grid wrap columns 
Css :: center align an image css 
Css :: input remove blue glow 
Css :: how to add shadow in css 
ADD CONTENT
Topic
Content
Source link
Name
8+6 =