CSS - Right Sidebar Problem
i have created a new model for a 3 column layout, (left sidebar, main content, right sidebar)
i used yui 3.0 index.php page as an example to float the main column right. this is designed to put the main column to static so that it is liquid, with a min width. im not working with a liquid layout however, so some adjustments are needing to be made. my site is 950 pixels wide. my sidebars are about 175 pixels each, when used. i have 2 classes that i append to the main column style depending on wether a left sidebar will be used or not. so when i set the #mainColumn for class .marginForLeftNav then it will accomodate for the left nav bar to pop up into place. if no left sidebar, then i use #mainColumn . marginForNoLeftNav class. The problem i am having is trying to accomodate the right sidebar, which will always be used. my requirements a 1) that the side bar html code falls below the main column code on the html page. so essentially i need to leave room in teh mainColumn for these columns to pop up into place. 2) that the styles used to float the left sidebar, and the main column are left in tact if possible. heres some code Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <style type="text/css"> <!-- #wrapper{ /* Wraps everything. Glues header, centralContainer, and footer together */ margin: auto; width: 950px; text-align: left; } #header { margin: 0; position: relative; background-color: #666; } #centralContainer { /* Glues left and right columns, and main area together */ zoom: 1; } #mainColumnWrapper { margin-left: -195px; overflow: hidden; float: right; } #mainColumn { margin-left: 195px; background-color: #999; position: relative; width: 560px; } #mainColumn .marginForLeftNav { } #mainColumn .marginForNoLeftNav { left: 0px; width: 755px; margin-right: 195px; } #leftColumn { float: left; width: 175px; position: relative; margin: 0; padding: 0; background-color: #CCC; } #rightColumn { width: 175px; margin-left: 775px; background-color: #CCC; position: relative; } #footer { color: #666666; font-size: 80%; border-top: 1px solid #333333; clear: both; padding-top: 10px; background-color: #FFF; } body { background-color: #333; } --> </style> </head> <body> <div id="wrapper"> <div id="header">header</div><!-- end header --> <div id="centralContainer"> <div id="mainColumnWrapper"> <div class="marginForLeftNav" id="mainColumn" > <p>main column, with class narginForLeftNav</p> <p> </p> <p> </p> <p>test</p> </div><!--end <div id="mainColumn" class="marginForLeftNav"> --> </div><!--end <div id="mainColumnWrapper"> --> <div id="leftColumn">left column area</div> <div id="rightColumn">right column area</div><!-- end rightColumn div --> </div><!-- end centralContainer --> <div id="footer">footer</div><!-- end footer --> </div><!-- end wrapper --> </body> </html> ive adjsuted the background colors to help see what is going on this is as close as i have gotten it so far. NOTICE, how the main column overflows behind the right sidebar, which makes the content in the right sidebar begin AFTER the bottom of the main column. this is obviously the main problem. I need the main column to obey the right sidebar, depending on wether theres a left sidebar or not. Similar TutorialsIE CSS Problem. sidebar getting pushed to bottom... I'm working on my new blog. Moding a template from wpdesigner.com http://www.mymovetoeurope.com/ The sidebar menu that is suppose to be on the right gets slipped to the bottom, but it's only for IE 6.0, don't have 7.0 installed. I tried using absolute positioning for the right bar, but it didn't do anything. When there were a lot of content in the sidebar and I increased the container size, it did push the menu back up, but the menu started at the edge of the header. I want to have it so the first right sidebar is under the header. Can someone tell me what's wrong? Thanks. The site is question is: http:// w ww.stolen-bikes.org/index4.php The CSS is: http:// w ww.stolen-bikes.org/css/non_ie.css Basically I want the sidebar (blue div), to line up on the side as it is but up flush against the top as you would expect a floated content area with a floated sidebar next to it. If I take out the #sidebar in the css it DOES align right up at the top as I want it to. The minute you as a float:left or width or anything it jumps down to the end of the #masthead div and beginning of the #content div. Im pretty sure I have everything lined up correctly I just cant figure out why this is doing that! Please help! ..never mind! I am presently creating a website for a friend of mine who's a model and wants her own website, I have decided to make it using xhtml and css. The problem that I am having is that I would like to have a footer which is at the very end of the page no matter how much content there is to the page. I have uploaded the code to here When this page is viewed in IE the footer is displayed at the bottom of the screen although the content carries on after the footer. When this page is viewed in Firefox the footer is displayed just below the bottom of the screen although again the content carries on after the footer. I have Googled this and tried out a couple of the suggested ways of getting the page to work and it just doesn't appear to want to work, so I am obviously doing something wrong :s Does anyone have any idea how I would be able to get the footer to stay at the very bottom of the webpage? Also if you look at the website you will see that the navigation sidebar only goes down as far as its content, I would prefer it if the sidebar went down to the footer (which will hopefully be at the bottom of the webpage). Again does anyone have any idea how I would be able to get it to do this. I tried a bunch of stuff to fix this. I only removed the sidebar from the pages, not the blog. This is how the footer is SUPPOSED to look: http://www.regionalcreations.com/fotografix/?page_id=4 This is how it looks on the pages: http://www.regionalcreations.com/fotografix/ For some reason the footer is up inside the body. Help? All I did was comment out the sidebar like this: Code: <!-- </div class="art-sidebar1"> <?php include (TEMPLATEPATH . '/sidebar1.php'); ?> </div> --> And copy the css for the width and change the name and values: Code: .page-contentLayout .page-content { position: relative; margin: 0; padding: 0; border: 0; float: left; overflow: hidden; width: 876px; } .page-contentLayout .page-content-wide { position: relative; margin: 0; padding: 0; border: 0; float: left; overflow: hidden; width: 875px; } I am working on a site in CSS (first time! Yay!) I am having one problem: there is a sidebar, and I have used spacer images to make the coloring go to the very bottom of the page (the links stop above that). HOWEVER: this is for my screen size, and I am worried that when people view it with a different screen/window size, they will have scroll bars, even though there is no content at the bottom. Is there any attribute that will make it just go right to the bottom? Thanx. I have three questions. 1. I saw some site which cut if there is a wide picture on side bars, like it just show the part which is on the sidebar box if its wider it cuts the extra part like this site if you see the first picture on the side bar its bigger but it cuts the extra part (-http://dot21.blogspot.com/-) , i want to know how to do it. 2. When some people add backgrounds they write background-repeat:no-repeat whats the function of that code??? and what can i write instead of no-repeat?? 3. whats the function of this code (background-position:bottom left) ??? If you couldnt answer some i hope you answer the ones you know. I'm trying to have a sidebar to the right of my page content that extends the entire height of the container it is in. Code: .sidebar { padding: 0px; margin: 0px; width: 150px; height: 100%; color: #999999; background: #ffffff; float: right; border-top: none; border-left: 1px solid #cccccc; border-bottom: none; border-right: none; } This is the code I am currently using, but it is only as tall as the contents of the div. I need the border on the left to extend the length of the container it is in. Any ideas? Thanks, Scott I'm a bit of a CSS newbie but I try. How do you get the sidebars' height to synchronize with the height of your content? I tried height=100% but it doesn't seem to work. If I put a lot of text in my content, it stretches down but the sidebars remain the same height, making the layout looking ugly. I don't want to have to press enter in my sidebars to match the content's height all the time! Here's my code: <style type="text/css"> #container { width: 100%; border: 1px solid gray; margin: 0px auto; } #banner { padding: 0px; background-color: #CDC8F1; } #content { padding: 5px; background-color: #FFFFFF; } #sidebar-a { float: left; margin: 0; padding: 0px; background-color: rgb(235, 235, 235); height: 100%; } #sidebar-b { float: right; margin: 0; padding: 0px; background-color: rgb(235, 235, 235); height: 100%; } #footer { clear: both; padding: 5px; background-color: rgb(213, 219, 225); } body { margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; } </style> Here's the main site: http: // anomalyrecords . net / index . html Here's the sto http: // anomalyrecords . net / catalog I am using a Zencart embedded template to wrap the main site design around Zencart.. This is working perfectly with a small remaining issue.. I am trying to synchronize the content placement of the sidebar items between Zen Cart and the rest of the site pages.. There is an ever so slight "shift" of the sidebar elements when you toggle bewteen the site pages and the store.. I've done a lot of tweaking and I'm fairly close, but I am at a COMPLETE loss how to put this to bed once and for all. I am hoping one of the CSS gurus here will see what I am clearly missing and guide me back to the light.. Hello everyone. I am working in wordpress trying to make a web site. I am pretty new to wordpress and i have basic CSS and HTML knowledge so i need some help with this. The website: Code: http://sitesuperhostdemo.com/m2/ 1. The #sidebar-1-wrap. The problem i am having is the sidebar. As you can see on the page the sidebar (#sidebar-1-wrap) is positioned under the content but i would want it to stand beside the content (#home-content). 2.The #content-sidebar-wrap. I didnt add this container it is built into wordpress but the problem is that anything i add in wordpress -> pages -> Home page is for some reason placed inside the #content-sidebar-wrap but i have no idea why. The #content-sidebar-wrap is streching my page down because it contains the sidebar but starts at the top of the default wordpress content and i am clueless as to how i can change it so it doesent include all the content i place on the page. I would like it to only contain #sidebar-1-wrap and if i am correct i assume i can then place the sidebar next to the content and stop the div from extending my page. 3. The sidebar position. I can for example set the following code to the #sidebar-1-wrap: Code: .home_page #sidebar-1-wrap { position: relative; top: -615px; left: 40px; } but there must be a better way. Also doing this doesent change the #content-sidebar-wrap. It still extends the page down as if the sidebar is still under the content. This would maybe work if i knew how to change the content so it isnt inside #content-sidebar-wrap but i see no way of doing it. Someone help please before i blow my brains out. If anyone needs clarification on anything lmk and ill clarify. I know this probably has a really simple answer but how do I make it so the sidebar is on the right side of the content box on a WordPress theme? Here is what it looks like right now: http://reptilenewsstation.1sthoster.com/ The sidebar is below the content box and I want it to be on the right side of the content box. I know the theme sucks right now but this is my first WordPress theme and I want to set everything up in the correct places before I start getting into really styling it. Hi all, At http://www.bartlett-family.net/chrisbartlett/blog2/ I have recently changed the entire layout and replaced it all with new images, BG, etc. In IE... On the right, the sidebar and BLOG searchform are all a little too far to the right. I've been playing with it all for a while, but can't seem to move it to the left. I basically just need to shift the entire righthand contents about 10 or 20 px to the left, but I need to avoid that also changing the righthanded content on all the other pages. Actually, in FF it is correct, except that the BLOG searchform bar needs to com over about 10-20px to the left. Other than that, it's perfect. I need to make IE look like that! CSS file is at http://www.bartlett-family.net/chrisbartlett/main.css I'd appreciate any help. Thank you! Chris Hello, this is my first time posting here. I am having a problem with a CSS sidebar. You can view the page at this URL: http://approg.msu.edu/david/ccsac/index2.htm. For the life of me, I cannot get the sidebar to automatically extend to the length of the page. Obviously, it's not much of an issue at the URL I listed, but it makes a bigger difference when there is a lot of content on the page. I'm sure the solution is simple, I just need to be pointed in the right direction. Thanks. This is a first I've seen my problem and I'm hoping it's something silly stupid. check out the site, code is listed below as well: http://bigoak.kjellandrew.com Ultimately I'm trying to float the sidebar to the left of the main content. First thing I notice is that the banner image has excess margin that is anywhere in the CSS. I've tried everything to eliminate that spacing and am starting to think it's related to my other problem. Second is that when I try to float the side bar (float: left on content and float: left on sidebar) it kills the div #body prematurely. You can tell cause the background color disappears and using firebug proves it showing that the body div is shortened. I've tried specifying heights (min height does extend it, but ultimately not a fix). I've made sure all of my divs are closed in proper order. And I've checked for random ", ', }, or / in my CSS and html and it's totally clean. It validates just fine too. HELP Code: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Big Oak - Home</title> <style type="text/css"> * { margin: 0; padding: 0;} a img { border: none; } .clear { clear: both; } body { background: url('_img/outside_bg.png') no-repeat top center #59858b; } #body { margin: 0 auto; margin-top: 50px; background-color: #fff; width: 950px; height: 100%; } #header { background: url('_img/header_wood.jpg') no-repeat top; width: 950px; height: 75px; } #header h1 { text-indent: -9000px; font-size: 0; } #header img.logo { float: left; position: relative; top: -50px; } #header img.banner { margin: 0px auto; } #header ul { float: left; list-style: none; padding-top: 40px; width: 480px; } #header li { display: inline; margin: 10px; font-family: helvetica; font-weight: normal; font-size: 1em; } #header li a:link, #header li a:active { text-decoration: none; color: #231f20; } #header li a:hover, #header li a:active { border-bottom: 2px solid #444; } #header form { float: left; margin: 30px 5px 0 0; display: inline; } .searchbox { height: 1.5em; font-size: 1em; padding: 2px 2px 2px 5px; width: 140px; vertical-align: middle; border: 1px solid #ccc; } .searchsubmit { vertical-align: middle; } #social_links img { float: left; padding: 30px 5px 0 0; } #container { width: 890px; margin: 0px auto; } #content { width: 560px; float: left; } #sidebar { width: 270px; margin-left: 25px; } </style> </head> <body> <div id="body"> <div id="header"> <h1>Big Oak</h1> <a href="/"><img src="_img/bigoak_logo.png" alt="big oak logo" class="logo" height="119" width="142"></a> <ul class="nav"> <li><a href="#">about</a></li> <li><a href="#">speaking</a></li> <li><a href="#">a:life</a></li> <li><a href="#">go events</a></li> <li><a href="#">contact</a></li> </ul> <!-- ends main navigation list --> <form method="get" action=""> <p><input type="text" class="searchbox"> <input type="image" src="_img/go.png" class="searchsubmit"></p> </form> <div id="social_links"> <a href="#"><img src="_img/facebook.png" alt="facebook"></a> <a href="#"><img src="_img/twitter.png" alt="twitter"></a> <a href="#"><img src="_img/rss.png" alt="rss"></a> </div> <!-- ends social links div --> </div> <!-- ends header div --> <div id="container"> <img src="_img/header_img.jpg" alt="banner" class="banner" width="890" height="270"> <div id="content"> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam adipiscing ultrices scelerisque. Fusce suscipit nulla eu sem placerat imperdiet. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Mauris laoreet suscipit risus id elementum. Sed massa ante, ornare nec rutrum sit amet, fringilla ac quam. Donec sed rutrum sem. Aenean vulputate molestie quam, eget vehicula justo pellentesque quis. Aliquam consequat est vitae purus pellentesque aliquam. In sagittis dolor et dolor fermentum mattis. Sed sed purus urna, feugiat suscipit tellus. Etiam sollicitudin metus in ante consectetur pretium vulputate ligula fringilla. Sed condimentum dignissim ipsum ut consectetur. Curabitur pellentesque placerat neque. Nam ante sem, condimentum eget aliquet eget, auctor vitae nunc. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer lacinia odio in ante consectetur condimentum.</p> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam adipiscing ultrices scelerisque. Fusce suscipit nulla eu sem placerat imperdiet. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Mauris laoreet suscipit risus id elementum. Sed massa ante, ornare nec rutrum sit amet, fringilla ac quam. Donec sed rutrum sem. Aenean vulputate molestie quam, eget vehicula justo pellentesque quis. Aliquam consequat est vitae purus pellentesque aliquam. In sagittis dolor et dolor fermentum mattis. Sed sed purus urna, feugiat suscipit tellus. Etiam sollicitudin metus in ante consectetur pretium vulputate ligula fringilla. Sed condimentum dignissim ipsum ut consectetur. Curabitur pellentesque placerat neque. Nam ante sem, condimentum eget aliquet eget, auctor vitae nunc. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer lacinia odio in ante consectetur condimentum.</p> </div> <!-- ends content area --> <div id="sidebar"> <h3>Cool Sidebar</h3> <ul> <li>item 1</li> <li>item 2</li> </ul> </div><!-- ends sidebar div --> </div> <!-- ends container div for main area of content --> </div> </body> </html> How's it going, If you look at this link below, you'll see how one of the images below is larger than the content area and thus goes over into the sidebar...which looks really wack. http://www.sustainablelivingrealest...-home-for-sale/ Is there a way to confine all images so they don't spew over, without actually resizing each image in Photoshop? Thanks in advance. Hello, I'm developing an intranet forum system with a design similar to Google Groups i.e. a sidebar with links to each message in the current thread, and a main content area to display the actual messages. Each area, i.e. the sidebar and the main content area, is a DIV. I have set the sidebar to width:25% and the main area left:25%, width:75%. My problem comes when I want each area to scroll (the main area vertically, and the sidebar horizontally). My plan is to use overflow:auto; this works fine with the main content area, but with the sidebar the text wraps around onto a new line if it overflows the DIV. This appears to be because the text is "hitting" the other DIV, i.e. the main content area, forcing it onto a new line. So can I do this using DIVs or do I have to resort to frames (I hope not, frames are SO messy and long-winded compared to DIVs....) Thanks, Nick Hi all, noob here. I am trying something pretty simple but just cant get it to work. For my site, I have a main content area and two right sidebars. I am trying to decrease the width of the the content area and widen the sidebars to fill the extra space created, say 50px. I have come unstuck trying to get it done though. Below is the relevant part of the css: Code: /* CONTENT layout */ #content { float: left; width: 100%; padding-bottom: 2em; } .sidebar-double #content, .sidebar-left #content { margin-left: -221px; } .sidebar-double #content, .sidebar-right #content { margin-right: -271px; } .sidebar-right-double #content { margin-right: -448px; } /* Add blanks left and right for the sidebars to fill */ .sidebar-double #squeeze, .sidebar-left #squeeze { margin-left: 221px; } .sidebar-double #squeeze, .sidebar-right #squeeze { margin-right: 271px; } .sidebar-right-double #squeeze { margin-right: 448px; } /* Add whitespace to content area */ #squeeze { padding: 1em 0 1.5em; overflow: hidden; } .sidebar-double #squeeze, .sidebar-left #squeeze { padding-left: 2em; } .rightbar #squeeze { padding-right: 2em; } /* SIDEBAR layout */ #sidebar-wrapper .sidebar { float: left; z-index: 2; position: relative; } #sidebar-left { width: 221px; } #sidebar-right-sec { width: 200px; padding: 1.2em 0; } #sidebar-right { width: 248px; padding: 1.2em 0; } .rightbar .top-corners { right: -8px; top: -3px; padding-right: 8px; position: relative; min-height: 12px; } .rightbar .bottom-corners { right: 0; bottom: -4px; position: relative; min-height: 7px; } I have tried changing the content or 'squeeze' margins as its called and then just widening the sidebars but it just doesnt work. If anyone can help it would be great, thanks! Hi, I have been having trouble fixing the coding on my site to be able to withhold the same content size while the window is being re-sized. Before I added min-width: 800px to my main content, it was being squeezed by the sidebar to force the letters/images to the left. Now with the code implemented, the sidebar reacts differently. It is being forced to the bottom as it meets the min-width of the content. Site: Diablo 3 Kore - Please google it - [can't link yet] CSS: /* Content */ #fw-bigcontain {padding: 3px; min-width: 800px; float:right;} #fw-columnContainer {} #fw-mainColumn {margin: 0px;} #fw-paragraph {} .fw-paragraphtop {} .fw-text {} h3.fw-title {background: url(()) no-repeat scroll;color: white; font-size: 17pt; font-family: 'Clarendon Cn BT';} /* Sidebar */ #fw-sidebar h3.fw-title {background: url(() no-repeat left center; font-size: 14px; margin-bottom: -8px; height: 13px;} #fw-sidebar {min-width: 245px; float: right; background:black; padding: 7px;} #fw-sidebar li {} .hasSidebar #fw-sidebar .fw-title {font-size: 12pt; font-family: 'SonicCutThru Hv BT';} /* end sidebars */ I haven't seen any css code I implemented that I could carry over to the sidebar code that could do the same thing. Well, please help me resolve this issue. Thank you. I would like to have a sidebar that vertically stretches to the height of its wrapper div. The sidebar contains two divs (a menu and a graphic) one of which is aligned to the top of the sidebar and one of which is aligned to the bottom. Thus when the sidebar stretches vertically, the space in between the menu and the graphic stretches. I currently have a floated sidebar with a fixed width and relative postion. That sidebar is in a wrapper div that is also relatively positioned. There is a menu and a graphic (#mascot) inside of the sidebar. My current CSS only allows the sidebar to be vertically as big as the two items in it. Here is my CSS: Code: #wrapper { padding:0px; margin:5px auto 10px auto; border:solid 1px white; border-collapse:collapse; width: 800px; height:100%; position:relative; } #sidebar { margin:0px; padding:0px; width:220px; float:left; background:url(_images/team/bg_nav.jpg); position:relative; } #sidebar #menu { margin:0px; padding:0px; border:solid 1px #000; } #sidebar #mascot { margin:0px auto; padding:10px; text-align:left; background:url(_images/team/bg_mascot.jpg); font-size:10px; font-weight:normal; font-family:Arial, Helvetica, sans-serif; color:#000; text-align:center; border:solid 1px #000; } #mainContent { margin:0 2px 0 222px; background:#FFF; padding: 10px; } #footer { margin:0px; padding:0px; width:100%; background:url(_images/team/bg_footer.jpg); font-size:10px; font-weight:normal; color:#FFF; text-align:center; } I would really appreciate any help as I am relatively new to CSS. If the code is confusing I'd be happy to expound on anything. Thans in advance, Brian |