scottjenson,
@scottjenson@social.coop avatar

challenge!

<body>
<div class="container">
<div class="item">item 1</div>
<div class="item">item 2</div>
<div class="item">item 3</div>
<div class="item hidden">item 4</div>
</div>
</body>

where .hidden { display: none }

Question: Can I use item:last-child {} to stylize item 3?

Apparently :last-child targets the last child in the DOM, not the last visible child. (this means hidden item 4 is styled.

Is there any way to do this using only CSS?

  • All
  • Subscribed
  • Moderated
  • Favorites
  • CSS
  • kavyap
  • thenastyranch
  • Durango
  • DreamBathrooms
  • ngwrru68w68
  • magazineikmin
  • cisconetworking
  • Youngstown
  • mdbf
  • slotface
  • osvaldo12
  • GTA5RPClips
  • rosin
  • InstantRegret
  • provamag3
  • everett
  • cubers
  • vwfavf
  • normalnudes
  • tacticalgear
  • tester
  • ethstaker
  • khanakhh
  • modclub
  • Leos
  • anitta
  • megavids
  • JUstTest
  • All magazines