I select certain divs with pseudo-selectors first-child and last-child, but: first-child does not work in any browser in which I checked it. I checked caniuse.com and css tricks. com, and the consensus is that: the first child is pretty widely supported, so I think maybe there is a bug that I don't know about. I am running the application on a local node server. I have confirmed both my css and my html. Does anyone know of any errors that may interfere: the first child from work?
HTML
<div class="col-md-6 blurbs"> <label>NEWS</label> <div> <p>Lorem ipsum dolor spernatur aut odit aut fugit conse oluptate</p> </div> <div class="clearfix"> <a class="pull-left">RSS</a> <a class="pull-right">MORE NEWS</a> </div> </div>
CSS
(does not work)
.news .blurbs div:first-child{ outline: 1px solid red; height: 260px; overflow: auto; margin-bottom: 10px; }
(working)
.news .blurbs div:last-child{ outline: 1px solid red; width: 95%; }
source share