I am working on a template for a database driven page, ideally there should be four divs for this content:
----- ----- | 1 | | 2 | ----- ----- ----- ----- | 3 | | 4 | ----- -----
The same content will always be in the same blocks. News is in # 1, images in # 2, etc. Based on the content provided, there may be all of these sections or just one. If, for example, window 2 does not exist, how can I get window 1 to expand to the width of the parent div?
i.e:.
----------- | 1 | ----------- ----- ----- | 3 | | 4 | ----- -----
or if 3 and 4 do not exist
----------- | 1 | ----------- ----------- | 2 | -----------
Of course, it could be something that can only be done using if / then statements, but I was wondering if there is a way to do this in CSS ... Or could it be jquery? I feel it should be easy, but my brain just doesn't know how to do it.
I set two floating margins 50% wide side by side, but I'm not sure how it will know how to expand if the other is missing.
Thanks!
Edit: Adding HTML! There is nothing interesting there ...
<div class="auth-secondary"> <div class="auth-upcoming auth-3d"> <span class="auth-h3">Upcoming Events</span> <p> <strong>March 5, 2014</strong><br> Book signing </p> <p> <strong>March 5, 2014</strong><br> Ice cream party </p> </div> <div class="auth-media auth-3d"> <span class="auth-h3">Media Gallery</span> <p> <img src="http://placehold.it/74x74"> <img src="http://placehold.it/74x74"> <img src="http://placehold.it/74x74"> <img src="http://placehold.it/74x74"> </p> </div> </div>
jquery html css
peridot1986
source share