atrum Posted July 19, 2008 Share Posted July 19, 2008 Hello all, recently I have been trying to design a menu using HTML and php, the issue I have is I want to separate the different subsections with out making a new page. So basically you could ether click a link to a section on a page or scroll down. My question is regarding the empty space between the sections, What is the best way to add empty space, or white space? At the moment, I am just using like 10x <br> tags, but somehow I think that seems a tad inefficient. Is there a better way to do this? Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted July 19, 2008 Share Posted July 19, 2008 Use padding or margin instead. Quote Link to comment Share on other sites More sharing options...
atrum Posted July 19, 2008 Author Share Posted July 19, 2008 Could you give me an example, I don't have much experience with padding or margins. I would really appreciate it. Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted July 19, 2008 Share Posted July 19, 2008 Read up on CSS. Quote Link to comment Share on other sites More sharing options...
atrum Posted July 19, 2008 Author Share Posted July 19, 2008 hmmm, well going by some of the examples I have seen. would doing this make sense? div { margin-bottom: 10cm; } Quote Link to comment Share on other sites More sharing options...
TheFilmGod Posted July 19, 2008 Share Posted July 19, 2008 <div id="box"> div contents </div> css.... #box { margin: 10px 0 0 0; } This literally means.... give a 10 pixel margin-top to the div with the id of box. Hope that helps! Quote Link to comment Share on other sites More sharing options...
atrum Posted July 19, 2008 Author Share Posted July 19, 2008 Thanks, One more quick question though, is it better to us top or bottom with margin, or does it matter? Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted July 19, 2008 Share Posted July 19, 2008 Margin can be applied to any side (top, right, bottom or left) of an element. It is up to you to which side you want to apply the margin. Quote Link to comment Share on other sites More sharing options...
atrum Posted July 20, 2008 Author Share Posted July 20, 2008 Thanks, I am glad I asked about this, I have been able to clear up alot of my pages using this method. Quote Link to comment Share on other sites More sharing options...
TheFilmGod Posted July 21, 2008 Share Posted July 21, 2008 Thanks, One more quick question though, is it better to us top or bottom with margin, or does it matter? Better to add margin to the top. I never add margin to the bottom. If you think of a brick house - where each brick is laid on top of another, and connect it to divs, then you will notice that adding margin JUST to the top (and doing it consistently) will render the page fine. Whichever you choose, don't do both. Browser inconsistencies, and just seems unprofessional. Padding is a different story, though. Quote Link to comment 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.