toolman Posted February 12, 2015 Share Posted February 12, 2015 Hi,I have the following markup: <div calss="tab-container"> <div id="tab1" class="tab-content">tab1</div> <div id="tab2" class="tab-content">tab2</div> <div id="tab3" class="tab-content">tab3</div> <div id="tab4" class="tab-content">tab4</div> </div> I would like to apply some CSS to only the CLASS of div ID 4. Is this possible?Thanks Quote Link to comment https://forums.phpfreaks.com/topic/294554-target-div-with-class-and-id/ Share on other sites More sharing options...
cyberRobot Posted February 12, 2015 Share Posted February 12, 2015 Have you tried something like .tab-container #tab4 { /* your style declorations go here */ } Note that <div calss="tab-container"> Should be <div class="tab-container"> Quote Link to comment https://forums.phpfreaks.com/topic/294554-target-div-with-class-and-id/#findComment-1505541 Share on other sites More sharing options...
jeffreyappel Posted February 27, 2015 Share Posted February 27, 2015 First thing first.You can use in a way lke Mother.child. Hence, First use the class "tab-container" and then any item under this class.so i should look like this: .tab-container#tab4 Good Luck Quote Link to comment https://forums.phpfreaks.com/topic/294554-target-div-with-class-and-id/#findComment-1506953 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.