The new forums will be named Coin Return (based on the most recent vote)! You can check on the status and timeline of the transition to the new forums here.
The Guiding Principles and New Rules document is now in effect.
I am working on a website for my final project and I am running in to an issue right now that I can't quite figure out. I have a single div that contains the bulk of the site. Inside of this div is two other divs and I can't figure out how to make those two divs appear to mesh together.
I want the div "topBox" to mesh with the div "mainpage" so that there is no gap in there when the webpage renders.
I have a css file where I control the id's for all of the divs. I have tried to set the margin and padding to zero and that just does not seem to get them to mesh so they appear as one. What can I do? I am trying to avoid frames at this point.
Signature??
Kato on
0
Posts
admanbunionize your workplaceSeattle, WARegistered Userregular
HTML and CSS are messy, so this is tough to answer without seeing the code or the result. Do you have Firebug or similar to inspect the resulting elements to see if it could be inheriting margin or padding from another element?
Like with no space between the divs? That shouldn't matter, but...
Also, it's possible that your CSS is setting margin/padding to something other than 0 via the ID or whatever. You should get DOM Inspector installed and take a look at the DIVs and see what the computed margin/padding are. Alternatively, does this work?
Thanks guys. I think I found what was causing it...seems I forgot to make the <p> tag to be set with no top margins. Once I did that, everything seems to be coming together the way it should be.
Also...I hate frame, which is why I was trying to avoid using them. That would have been an easy fix, but frames suck these days.
But yeah I suspect it's your browser adding padding and margin to your elements, if you haven't set them to 0 in the CSS
Hey, that's a perfectly reasonable suggestion given his name!
I fought with this same thing awhile back on my own website. It was actually the content inside the div causing weirdness for me. I had a tag inside one of the inner divs which had top and bottom margins and was pushing everything out.
So it was like
<div class="container">
<div class="upper">
some text
</div>
<div class="lower">
<ul> <!-- this is the tag that caused trouble and needed 0px top and bottom margins added -->
<li>list stuff
</ul>
</div>
</div>
Posts
Don't use frames.
Like with no space between the divs? That shouldn't matter, but...
Also, it's possible that your CSS is setting margin/padding to something other than 0 via the ID or whatever. You should get DOM Inspector installed and take a look at the DIVs and see what the computed margin/padding are. Alternatively, does this work?
Hopefully not!
But yeah I suspect it's your browser adding padding and margin to your elements, if you haven't set them to 0 in the CSS
Also...I hate frame, which is why I was trying to avoid using them. That would have been an easy fix, but frames suck these days.
I fought with this same thing awhile back on my own website. It was actually the content inside the div causing weirdness for me. I had a tag inside one of the inner divs which had top and bottom margins and was pushing everything out.
So it was like