How to make sidebar and main body the same background/length
PermalinkIn certain browsers it is not lining up correctly. My preference would be to have the sidebar and main body line up no matter how long the text would be on either side (short sidebar vs long main body or long sidebar vs short main body).
Does anyone know how to do this? It's driving me crazy
the site is mywebhelp.com
Thanks!
I have attached a screen shot (note the yellow is not the background of this site) to show you what I mean.
Or something similar!
You would need to
- Upload the equal height jquery addon to the /js folder.
- Modify the theme page layouts with a class '.make_these_equal' applied to the div elements of the main and sidebar areas, that you could then use to identify them later.
- Modify the theme header to load jquery and the equal height addon.
- Add some javascript to the theme footer to set the equal height.
Why use javascript when you can use css?
Couple of mods to styles and your done!
As per my attachment...
body {/* customize_background */ background-color: #66CC66; /* customize_background */ padding: 0px; margin: 0px; }
#page{background:#FFF; width:800px; margin:auto; text-align:left;padding:20px }
#page #central #sidebar{background:#EEE; float:right; width:23%; overflow:hidden;padding:10px }
See attached
your method worked, but for some reason it didn't take until I did an edit to something else on the css and then changed it back.
It's perfect.
Thank you!!
K
#content {
width: 665px;
float: left;
padding-right: 20px;
border-color: #b8b7b7;
border-right-style: solid;
border-right-width: 1px;
height: 100%;
}
#sidebar {
width: 190px;
margin: 0 0 0 -1px;
float: left;
padding-left: 10px;
border-color: #b8b7b7;
border-left-style: solid;
border-left-width: 1px;
height: 100%;
}
I'm using a right sidebar in this case. What I had to do was to make the line overlap, which is why I've entered a margin of -1px on the left side of the sidebar.
I'm very new to all this, but thought I'd share this anyway since I was looking for something like this!
For example:
body {background:#66CC66}
content {background:#FFF}
sidebar{background:#FFF}