I have n number of containers which has some divs. But I need to change the particular container's width which has . How to achieve this only using css.? (I can do this using Jquery)
if ($(".container #content").length > 0){ $(this).closest('.container').css('width','450px'); } <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <div class="container"> .... </div> <div class="container"> .... </div> <div class="container"> .. <div id="content">...</div> .. </div> <div class="container"> .... </div>
.container450pxwide if it contains#content? You could make.containerdisplay: inline-blockand then give#contentwidth: 450. That would do it, though hard to say if it would work for you without more context.display:inline-block, Because it will affect all other pop-up modal (I don't want to change anything on other container classes).