- This topic has 3 replies, 3 voices, and was last updated 4 years, 2 months ago by .
Viewing 4 posts - 1 through 4 (of 4 total)
Viewing 4 posts - 1 through 4 (of 4 total)
- The forum ‘CSS’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Hello together,
i searched around but couldn’t find anything which helps concerning my problem.
Can you please have a look to this codepen: https://codepen.io/helson/pen/eYmebGq ?
I have two or more blocks of the following div with class “slider”. A additional div (sliders) is wrapping these togehter.
< div class="slider" >
< div class="col" >
< div class="bs_tab_toponly" >
< h1 class="tabheading" >tabheading< /h1 >
< /div >
< /div >
< div class="w-100" >w-100< /div >
< div class="col no-gutter" >< /div >col no-gutter
< div class="w-100" >w-100< /div >
< div class="col" >last-col ***RED***
< div class="bs_tab_bottomonly" >bs_tab_bottomonly< /div >
< /div >
< /div >
I want to style the last “col” containing “bs_tab_bottomonly” different – how can I achieve this?
I played around with last-child, last-of-type but can’t find the solution.
First-child works as expected (for me).
Thank you in advance!
BR
heslon
.sliders .slider:nth-child(2) .col:last-child {
background-color: red;
}
Hello Mattia,
thank you for your reply – this works for two container (.slider). But what if the number of “.slider”-divs vary?
BG
helson
Hello there. Interesting thread, thanks for the information.