Jump to content

Div Displays Wrong


Grabeorama
 Share

Recommended Posts

I have this page.There are two divs inside a larger div. One of the inner divs contains "COMP 04" the other contains "BLACK". I am trying to have a vertical gap between the two of them, but if I put in <br /> or <hr /> it still won't make a gap.I've also tried putting position: relative; top: 20px; in the CSS, that works but throws off the layout (the bottom div sticks out of the container and looks horrible!)Do you have any ideas how I can fix this problem? If you want the CSS file let me know :) or you can get it off the view page source.Thanks~Grabeorama

Link to comment
Share on other sites

<br> is a very inexact tool for creating a gap. And you should always reserve relative and absolute positioning for situations where nothing else works, since they can create unintuitive side effects (I'm think your "bottom div sticks out" problem is one of these.)For a horizontal gap between divs, the normal thing is to apply a margin-bottom to the top element or a margin-top to the bottom element.It doesn't look as if #main has a fixed height, so hopefully adding some margin will simply cause #main to grow.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...