Takararyuu Posted October 21, 2013 Share Posted October 21, 2013 Hi there! I was just wondering, there is a theme named 'Tetris' for wordpress. (Link) When posts are placed they float to the left and line up to the top neatly. Well currently i am creating a wordpress based website, and on the pages i use '#homediv' to id the div's that i want to do the same. Problem with how i coded it: they do float left, but do not line up to the top... I tried to search the code of 'Tetris' how they manage to do it, but couln't figure it out. If you know how to make this happen please tell me (and the others that search for the same problem on Google and land here). Code as it is now: /*CSS OF HOMEDIV:*/ #homediv { width:45%; min-width:180px; float: inherit; border:solid 1px #7D1517 ; margin:1%; border-bottom-left-radius:10px; -moz-border-bottom-left-radius:10px; -o-border-bottom-left-radius:10px; -webkit-border-bottom-left-radius:10px; border-bottom-right-radius:10px; -moz-border-bottom-right-radius:10px; -o-border-bottom-right-radius:10px; -webkit-border-bottom-right-radius:10px; padding-bottom:15px; } #homediv h5 { text-align:center; background:#7D1517; color:#FFF; } #homediv h6 { margin-left:3%; margin-right:2%; } #homediv p { margin-left:2%; margin-right:2%; } Image example: As you see, they do not line up to top. Thanks in advance! - Marcel Link to comment Share on other sites More sharing options...
thescientist Posted October 21, 2013 Share Posted October 21, 2013 (edited) I'm not sure what you, by that they don't line up up top? Are you talking about want the "Geen slaging.." box to be right below the the bottom of the box above it, without the space? Edited October 21, 2013 by thescientist Link to comment Share on other sites More sharing options...
Takararyuu Posted October 21, 2013 Author Share Posted October 21, 2013 (edited) I'm not sure what you, by that they don't line up up top? Are you talking about want the "Geen slaging.." box to be right below the the bottom of the box above it, without the space? Sorry, yes that is what i intend to make. No white spaces in between like in the 'Tetris' theme. EDIT: Life example Edited October 21, 2013 by Takararyuu Link to comment Share on other sites More sharing options...
Ingolme Posted October 21, 2013 Share Posted October 21, 2013 Just make two columns, and put the rest of the boxes inside: <div id="columnA"> <div class="box">Box</div> <div class="box">Box</div> <div class="box">Box</div> <div class="box">Box</div></div><div id="columnB"> <div class="box">Box</div> <div class="box">Box</div> <div class="box">Box</div> <div class="box">Box</div></div> #columnA { width: 50%; float: left; padding: 1px 0; /* Prevent collapsing margins */}#columnB { margin-left: 50%; padding: 1px 0; /* Prevent collapsing margins */}.box { border: 1px solid red; border-radius: 10px; -moz-border-radius: 10px; margin: 5px 10px;} Link to comment Share on other sites More sharing options...
astralaaron Posted November 1, 2013 Share Posted November 1, 2013 padding: 1px 0; /* Prevent collapsing margins */ What do you mean by collapsing margins? Link to comment Share on other sites More sharing options...
thescientist Posted November 4, 2013 Share Posted November 4, 2013 https://www.google.com/search?q=collapsing+margins+css&oq=collapsing+margins+css&aqs=chrome..69i57j0l5.4364j0j7&sourceid=chrome&espv=210&es_sm=119&ie=UTF-8 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now