OsakaWebbie
Programmer
I often run into pages that, due to CSS problems, have blocks writing on top of one another. But now that I actually want to do that, I can't figure out how.
Here's my code, with some borders added so that I can see what's going on (it's part of a Joomla template, but the question is pure CSS):
And here is the relevent CSS:
You can see it in action here: (I have other issues with the template that I am trying to resolve, so just ignore any craziness you might see in the upper portion of the page.)
I also tried commenting out the "copyright" div around the centered text so that the text was just in the overall footer div. But either way, the syndicate div (which currently has no content, as I'm not yet using that Joomla module) and the design div consume space that the centered text avoids. In FF the blank syndicate block has no height, so the centered text centers in the left 2/3 of the footer, and in IE the blank block has height, so the two lines of the centered text are skewed. I want the centered text to stay in the center regardless of what else exists or not - yes, I know that if the user makes the font really big, stuff will overlap, but that's okay. How can I get the two side divs to just layer on top of the area that the middle text gets written in? Apparently "display:block;float:left-or-right" is not the right method. Thanks for putting up with my newbie lack of understanding of floats and other CSS positioning things.
Here's my code, with some borders added so that I can see what's going on (it's part of a Joomla template, but the question is pure CSS):
Code:
<div id="footer">
<div class="syndicate" style="border:1px solid white">
<jdoc:include type="modules" name="syndicate" />
</div>
<div class="design" style="border:1px solid yellow">
Design & content by OIC members<br /><?php echo JText::_('Powered by');?> <a href="[URL unfurl="true"]http://www.joomla.org/">Joomla!</a>[/URL]
</div>
<div class="copyright" style="border:2px solid red">
© 2004-2008 Osaka International Church<br />
2-26-47-407 Tamatsukuri, Chuo-ku, Osaka 540-0004 Japan
</div>
</div><!-- footer -->
Code:
#footer {
background:darkcyan;
color:#fff;
padding:5px;
text-align:center;
border-top:solid 4px #000;
}
#footer .syndicate {
float:left;
width:30%;
display:block;
text-align:left;
}
/* #footer .copyright {
float:left;
width:100%;
display:block;
text-align:center;
} */
#footer .design {
float:right;
width:30%;
display:block;
text-align:right;
}
I also tried commenting out the "copyright" div around the centered text so that the text was just in the overall footer div. But either way, the syndicate div (which currently has no content, as I'm not yet using that Joomla module) and the design div consume space that the centered text avoids. In FF the blank syndicate block has no height, so the centered text centers in the left 2/3 of the footer, and in IE the blank block has height, so the two lines of the centered text are skewed. I want the centered text to stay in the center regardless of what else exists or not - yes, I know that if the user makes the font really big, stuff will overlap, but that's okay. How can I get the two side divs to just layer on top of the area that the middle text gets written in? Apparently "display:block;float:left-or-right" is not the right method. Thanks for putting up with my newbie lack of understanding of floats and other CSS positioning things.