CSS - Layout Woes - Jquery Script Breaking Layout
Hello, I am using an OS Commerce layout for a client's website. On this page - www.mts-diesel.com you will see how I have the homepage laid out in anticipation of design, with 3 divs of varying colors. One div with an id of #hp_left is where I want to put a nice jquery code. But when I insert that into #hp_left it breaks the whole layout, was seen here www.mts-diesel.com/index2.php I'm not sure what in the css in the code for this script is breaking my layout but Ithought someone here might be willing to shed some light. A big thank you. Tom
Similar TutorialsPlease look at these two pages - www dot aamco-houston dot com www dot aamco-houston dot com/warranties.asp On the second page, in IE9, the navigation gets broken and put on two lines. In IE7, IE8, Firefox,etc. it looks fine. Can someone give me a workaround perhaps? Thanks. Tom I am jsut interested as to how you would go about creating a three column layout. The way im doing it at the moment is as follows Code: #left { float: left; width: 176px; margin: 0px; } #right { float: right; width: 176px; margin: 0px; } #content { margin: 0px 186px; } Code: <div id="left"></div> <div id="right"></div> <div id="content"></div> The above works very well UNLESS i want to put in a table of width="100%". If i do this then the content div falls below the left and right divs. By setting the width to 99% it then works again but i really need it to be 100% wide within the content div. One other thing, this works fine in firefox but falls in IE. Can anyone give me a clue as to why i am unable to do this and secondly a method to fix it? Thanks so much Andy Thanks in advance to anyone who can help. I've been spending some time moving from HTML 4 and a table-based layout to CSS-based layout and XHTML 1.1 compliance. Most of my site looks fine to me. However, on pages where there is not a lot of content in the right-hand column, the contents of the left-hand column end up looking very wonky in Firefox 0.8. It shows up fine in IE, but I don't trust IE. Here's an example of an offending page: http://www.thatlittlebastad.com/more.php?id=1286_0_1_0_M Here's my CSS file http://www.thatlittlebastad.com/style_040805.css Can anyone help? Hey, So I have a three column layout being implemented as such: html: Code: <div class="content"> <div class="col1 column"></div> <div class="col3 column"></div> <div class="col2 column"> <div class="header">Header</div> </div> </div> CSS: Code: .column { padding: 10px; position:relative; } .header { background:#cfe6f5; color:#416383; font-size:11px; font-family:Arial; font-weight:300; padding-left:15px; } .col1 { float: left; width:250px; } .col2 { margin-left: auto; margin-right: auto; } .col3 { float:right; width:250px; } The problem is that the width of the header div extends all the way to the left and right of the page when it's in the middle column, but behaves the way I want it to (extends to the left and right of the column) when it's in the left or right column. Any ideas? Thanks. --Surgery I am working on the new home page which is based on a template. The left sideColumn is working fine, however I am having a few problems with the mainColumn layout. Here is a static image to show what I want it to look like Here are the problems I am having: 1) The #scroll box is place where I want it in IE but in foxfire it is right up against the left side of the #sideColumn partially hidden. There will be text that scrolls into this box and stops. I haven't started on the part yet - in case that makes a difference. Not my choice, but that is what the bosses want. 2) I want the image centered horizontal within the #mainColumn. Here is what I have for the css: #home img { margin: 5px auto 5px auto; } which I thought would do the trick, but it's not. 3) I want the p text to have a 40px margin on the right and left side like the .large does. Here is what I have for the css: #home p, .large { margin: auto 40px auto 40px; } It works for the .large (Welcome to Vitalograph), but not for the text below it. At one point I had it working, but after addtional changes fixing other problems, now it doesn't and I can't figure out why. Here is the xhtml starting at the 2 column part (wrapper): Code: <!--begin wrapper--> <div id="wrapper"> <!--begin side column --> <div id="sideColumn"> <span class="category">Products</span> <ul> <li><a href="/products/spirometers.html">Spirometers</a></li> <li><a href="/products/clinical_trials.html">Clinical Trials</a></li> <li><a href="/products/asthma_copd.html">Asthma & COPD</a></li> <li><a href="/products/smoking_cessation.html">Smoking Cessation</a></li> <li><a href="/products/resuscitaion.html">Resuscitation</a></li> </ul> <span class="category">Resources</span> <ul> <li><a href="/resources/contact_us.html">Customer Support</a></li> <li><a href="/resources/training_services.html">Training & Services</a></li> <li><a href="/resources/exhibitions.html">Exhibitions</a></li> <li><a href="/resources/newsletters.html">Newsletters</a></li> <li><a href="/resources/downloads.html">Downloads</a></li> <li><a href="/resources/useful_links.html">Useful Links</a></li> <li><a href="/resources/industry_information.html">Industry Information</a></li> <li><a href="/resources/industry_information.html">Sitemap</a></li> </ul> </div> <!--end of side column --> <!--begin main column --> <div id="mainColumn"> <!-- InstanceBeginEditable name="Main_Section" --> <div id="home"> <div id="scroll"><span>scrolling news will go hear and stop</span></div> <img src="/images/boys_bubbles.gif" width="485" height="333" alt="boys and bubbles" /> <span class="large">Welcome to Vitalograph</span> <p>Vitalgraph offers a wide range of spirometers along with other asthma management equipment with over 40 years experience. From simple hand-held units to sophisticated Windows based spirometry systems, we have it all. Check out our full line of respiratory equipment under the product category.</p> <p><a href="/about_us/about_us.html">more about us...</a></p> </div> <!-- InstanceEndEditable --> </div> <!--end of main column --> </div> <!--end of wrapper--> Here is the vitalograph_master.css: Code: body { font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 12px; text-align: center; background-color: #ffffff; color: #515151; margin:0px; padding:10px; } /*page container settings*/ #page { width: 750px; height: 600px; border: 1px solid #5094F9; background-color: #FFFFFF; overflow: hidden; margin: auto; padding: 10px 10px 10px 10px; text-align: left; } /*logo header and tag settings*/ #header { margin: 0; padding-bottom: 5px; width: 450px; height: 36px; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; color: #5094F9; text-align: left; } #header img { vertical-align: -7px; } .tagline { color: #5094F9; font-size: 16; font-style: italic; font-weight: bold; display: inline; clear: both; line-height: 20px; margin-left: 10px; } /*top bar settings*/ #topbar { float: top; height: 20px; background-color: #5094f9; clear: both; padding-left: 10px; text-align: left; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; color: #FFFFFF; font-size: 12px; font-weight: bold; } #topbar a:link, #topbar a:visited { background-color: inherit; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; text-decoration: none; color: #FFFFFF; font-size: 12px; font-weight: bold; } #topbar a:hover, #topbar a:active { background-color: #FFFFFF; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; text-decoration: none; color: #5094F9; font-size: 12px; font-weight: bold; } #topbar ul { list-style: none; margin: 0; padding-top: 2px; } #topbar li { display: inline; margin-right: 160px; } /*Main Section two columns under top section*/ #wrapper{ padding: 10px 10px 10px 0px; width: 100%; height: 100%; } #sideColumn { float:left; width:155px; height: 78%; background-color: #5094F9; padding-top: 50px; padding-left:10px; padding-bottom:10px; pading-right: 10px; margin-right: 10px; text-align: left; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; color: #FFFFFF; font-weight: bold; line-height: 20px; } .category { font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; color: #FFFFFF; font-size: 16px; font-weight: bold; letter-spacing: 5px; } #sideColumn a:link, #sideColumn a:visited { background-color: inherit; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; text-decoration: none; color: #FFFFFF; font-size: 12px; font-weight: bold; } #sideColumn a:hover, #sideColumn a:active { background-color: #FFFFFF; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; text-decoration: none; color: #5094F9; font-size: 12px; font-weight: bold; } #sideColumn ul { list-style: none; padding: 15px 0px 15px 10px; margin: 0px; } #mainColumn { padding: 0px; } /*footer*/ .footer { font-family: "Times New Roman", Times, serif; font-size: 9px; color: #999999; } /*text*/ .large { font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; color: #5094F9; font-size: 18px; font-weight: bold; margin-bottom: 15px; } Here is the home.css: Code: /*home page*/ #home { margin: auto; } #home img { margin: 5px auto 5px auto; } #home p, .large { margin: auto 40px auto 40px; } #home a:link, #home a:visited { background-color: inherit; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; text-decoration: none; color: #5094F9; font-size: 12px; font-weight: bold; } #home a:hover, #home a:active { background-color: inherit; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; text-decoration: none; color: #990099; font-size: 12px; font-weight: bold; } #scroll { width: 560px; padding: 5px; background-color: inherit; border: 1px solid #5094F9; margin-bottom: 5px; } Any help or suggestions are greatly appreciated. Hi guys, I never wanna do anything simply... *sigh* Need some help again! I downloaded SPGM to use as a photo gallery. Love it. It's even valid XHTML 1.0 Strict! Ok, I've implemented it here . Instead of using the native CSS file that came with the script, I copied it all into my own CSS file. Well, not ALL of it, but most. That CSS file is here . Towards the bottom, you'll see the SPGM CSS section. Now I've already started adapting the script and layout to my site, but as you can imagine, it's not too easy, especially for an only moderately-knowledgeable CSS user like me. First thing I want to do it... 1. I want to move the entire table (the main table containing the 4 folder icons and text) over to the left so the left side of the table lines up only a pixel or two right of the line between the green and tan on the left. I can shift the whole table by adding margin-left: -something px; to TABLE.table-wrapper, but the folder icons actually disappear as if they go behind something! HUH? I think moving this to the left more will solve the problem in IE of the right nav links getting pushed down... Could be wrong, but it's ok in FF. If someone could start me off with this I'd very much appreciate it. Thanks, guys! Chris Hi there and thanks for reading & helping! I am new to this site, but here is my question: I need to build about a 20 page website. I have been told I should do the "layout" for each page using CSS. Is it possible for each page to "link" to one CSS file for layout instructions? I have found suitable CSS layout templates but am unsure how to link each page to the external CSS file for a basic "header, 2 column, footer" layout, or if it is even possible? Trying to use jQuery UI aqccordions for a simple news widget on a site. I have created my widget and everything works and looks great but when I click a widget the containing div resizes and makes the whole page bump down a bit. I dont want to use any hard coded dimesnsions that are longer than the box since it would lose its effect. I need to keep the whole div able to resize whith the screen reolution. Code: <div id="newsAccordion" class="ui-accordion ui-widget ui-helper-reset"> <h3 style="line-height:0.3;" class="accordionTitle ui-accordion-header ui-helper-reset ui-state-default ui-corner-all" id="accordionTitle1"> <span class="widgetHeadline">Add news article 1 here</span> </h3> <div class="accordionContent ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content-active" id="accordionContent1" style="padding: 2px 5px;" > <span>News article 1 content</span> </div> <h3 style="line-height:0.3;" class="accordionTitle ui-accordion-header ui-helper-reset ui-state-default ui-corner-all" id="accordionTitle1"> <span class="widgetHeadline">Add news article 2 here</span> </h3> <div class="accordionContent ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content-active" id="accordionContent2" style="padding: 2px 5px;"> <span class="rightJustifiedAccordion">News article 2 content here</span> </div> <h3 style="line-height:0.3;" class="accordionTitle ui-accordion-header ui-helper-reset ui-state-default ui-corner-all" id="accordionTitle1"><span class="widgetHeadline">News article 3</span></h3> <div class="accordionContent ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content-active" id="accordionContent2" style="padding: 2px 5px;"> <span>News article 3 content here</span> </div> </div> Thanks in advance, Jim heyya, I'm doing a quick layout, and I'm running into some problems with my floating menu. Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <style type="text/css"> body { margin:0; padding:0; background-color:white; font:normal 1em/150% Verdana,Arial,sans-serif; } #container { width:750px; padding:0; margin:0; background:#FAA; } #contents { width:566px; margin:10px 0 0 162px; border:1px solid #999; border-bottom:none; padding:10px; background:#FFF; } #contents p {font-size:80%;line-height:150%;} #menu { width:160px; background:#FFA; margin:0; padding:0; float:left; } img {border:none} </style> </head> <body> <div id="container"> <div id="menu"> <p>Wisi te quis lobortis dolor vel hendrerit consequat ex. Nulla hendrerit ad et. Praesent adipiscing nostrud dolore, feugait velit dolore dignissim. Aliquam blandit consequat ex blandit praesent hendrerit. Commodo in nonummy suscipit facilisi lorem ullamcorper dolore vulputate ea, ullamcorper eum duis delenit. Iriure nostrud qui, vulputate ut aliquip at, amet ut, erat, consequat autem. Facilisis sit lorem te illum suscipit zzril. Dignissim illum, duis accumsan. Et, duis enim euismod wisi commodo elit amet. Hendrerit nulla luptatum dolore tincidunt nulla nulla minim velit feugait accumsan, dolore minim, feugait nonummy, elit vero erat.</p> </div> <div id="contents"> <a href="#"><img src="bedroom-furniture.jpg" width="566" height="250" border="0" alt="" /></a> <h3>Welcome to mook</h3> <p>Wisi te quis lobortis dolor vel hendrerit consequat ex. Nulla hendrerit ad et. Praesent adipiscing nostrud dolore, feugait velit dolore dignissim. Aliquam blandit consequat ex blandit praesent hendrerit. Commodo in nonummy suscipit facilisi lorem ullamcorper dolore vulputate ea, ullamcorper eum duis delenit.</p> <p>Facilisis sit lorem te illum suscipit zzril. Dignissim illum, duis accumsan. Et, duis enim euismod wisi commodo elit amet. Hendrerit nulla luptatum dolore tincidunt nulla nulla minim velit feugait accumsan, dolore minim, feugait nonummy, elit vero erat.</p> </div> </div> </body> </html> readers digest version: I have a 750px container. My content div is 566, plus 2px for the border, plus 20px for the padding. Giving it a margin-left of 162px gives us a grand total of 750. IE seems to hate the padding - when i modify that it works fine - even changing the margin doesn't do anything. and there's an extra 2px between the menu and the contents just in case. So I can't figure why it's bumping down in IE. and i'm using v6, and have the doctype declared, so it shouldn't be in quirks mode. TIA, Greg Hi, i've just started using css and have noticed a small problem in my code - i get a white bar above my header, but i'm not sure how to get rid of it. It only appers in firefox and not ie. my code is index.html Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Computer Aided Cookery</title> <link href="wecook.css" rel="stylesheet" type="text/css" /> </head> <body> <!-- container --> <div id="container"> <!-- start wrapper --> <div id = "wrapper"> <!-- start header --> <div id = "header"> <h5> BANNER GOES HERE</h5> <h5> BANNER GOES HERE</h5> <h5> BANNER GOES HERE</h5> <h5> BANNER GOES HERE</h5> <!-- start nav --> <div id="nav"> <ul> <li><a href="#">Home</a></li> <li><a href="#">About Us</a></li> <li><a href="#">Search</a></li> <li><a href="#">Contact Us</a></li> </ul> <!-- end nav --> </div> <!--end header --> </div> <!-- end wrapper --> </div> <h4> Copyright xyz.co.uk. 2006-2007 All rights reserved </h4> <!-- end container --> </div> </body> </html> css file Code: /* general html element formatting */ html, body, table { font-family: verdana, arial, sans-serif; font-size: 7pt; color: #000000; margin: 0; padding: 0; } body { margin: 0; padding: 0; } h1, h2, h3, h4, h5, h6 { margin: 10px 10px 10px 0px; text-align: center; } h1 { font-size: 150%; margin-top: 0px; } h2 { font-size: 130%; } h3 { font-size: 110%; } h4 { font-size: 100%; } h5 { font-size: 100%; color: #FFFFFF; } #container { background-image: url(images/background_gradient2.jpg); border: 1px solid #000000; } #wrapper { width: 760px; height: 600px; background-color:#FFFFFF; margin:10px auto; border: 1px solid #000000; text-align: left; } #header { width: 760px; background: #242424; } #nav { border-bottom: 1px solid #000000; } #nav ul { padding: 0; margin: 0; background-color:#242424; } #nav ul li { display: inline; padding: 0; margin: 0; } #nav ul li a { font-size: 120%; color: #FFFFFF; background-color:#778899; text-decoration: none; padding: 0px 25px 0px 25px; border-right: 0px solid #000000; text-align: center; width: 9em; } #nav ul li a:hover, #nav ul li a:focus { background-color: #990000; } please find attached a screenshot in firefox. Any help is appreciated. thanks! I'm working on converting a website from tables to div's and running into one little issue. The site is a basic header on top, navigation on left, content on right and a footer on the bottom. I would like the navigation div to grow in height to match the height of the content div so that the background fills the left side of the page. I have placed the nav and content divs in a container div and set a min-height on the container. I was hoping that that would let me place height: 100% on the navigation div but it isn't growing ever. Is there a way to get something like this done? FYI, the site is currently at http://users.adelphia.net/~mmorasch/ Hi there. I need help creating a certain layout. I need div borders around my layout, but without content inside them the background image is not seen. How could I resolve this without changing height:auto Thanks in advance Hi I want to achieve this layout using CSS http://www.premier-resin-systems.co.uk/layout.jpg I want it to be 3 columns, but as you can see the navigation part overlaps the red background image that I was going to put in my header div. I would like some help if poss on how to put this design into divs before I plough staright in!! Thanks for any help or advice! 'Ello, I have just started to create a new web site for my self about a game called Warhammer 40,000. Although I have come across a problem near the start of its construction. I have a layer in the top right hand part of the web site for the search fields, on Internet Explorer it positions it self fine, but in Netscape (tried in v7.2) and FireFox (tried in v1.0 and v1.0.3) it its slightly higher and in Opera it just displays it all the way off to the bottom of the web site. One thing I have noticed is that this layer aligns up perfectly in Opera providing there is nothing between the two div tags, which seems strange to me. Here is the home page of the web site, as you can see there isn't much done to it yet as I want to fix this problem before procceding onwards. My CSS document is located here. If you view this in Opera v7.52, Netscape v7.2, FireFox v1.0 and/or v1.0.3 and Internet Explorer v6 you will see what I men in the top right hand corner, may have the same effect in other versions of these browsers but I have not checked. Thank you in advance, El Barto. tiny pic .com/nqb f9i.png Hey, I'm super sorry for the url but that's the ONLY way you guys will know what I'm talking about. Obviously I'll be doing the more advanced graphics later. Please answer the following questions: I would like the white and the yellow to go on for the rest of the page (no matter how big your monitor is). How would I do this? I also want the green and the dark blue to stretch if I were typing more and more. (I know I would have to save the bottom of the sections of those images and the middle if I were to do this.) And I need this to be completely centered on the webpage. Overall, I can handle the rest. So what attributes/properties do I have to study to get this to work? If you're feeling super nice you can code it for me. ;D Ok I've been stuck on this layout for about 2 days and I've had it. I was wondering if someone would be willing to help me with it through AIM or MSN messager. Also if no one is willing to help I'm willing to pay someone 30-40$ to code the layout for me in CSS so it works in Firefox and IE. I pretty much just need the stylesheet or the one on one help to make it work. If you're willing to help me IM ME at stareatceiling or MSN: ajay@statc.net . It'd be cool to have this done tonight or tommorow so i can start developing the backend for it. Thanks. Hello. I am currently trying to learn CSS. I have experience in HTML, PHP/mySQL, and some .NET(ASP.NET & C#). I am currently working on a web design project. I know how beneficial CSS can be. I am understanding most of the concepts. I am trying to divide my page up into a parent main page. For example, there is a background color(style). On top of that is my parent main page section. It is similar to a piece of paper on top of a larger(darker) piece of paper. Then within that main page I am going to have about 3-4 separate boxes, which will make up different sections(news, departments, etc). The problem I am having is I have everthing setup with 1 box within the main page. However, I put the other box in the same nested <div class = "page"> tag and I can get it where I want in terms of left, right, and bottom positioning for margins. However, I can not get the 2 boxes to be on the same row. There is space on my page that I cannot use. With my prior experience I know that the solution to this problem was using nested tables. However, from my understanding I thought I could refrain from using tables and use some CSS techniques instead. Please give me any input you might have or any questions that might seem confusing. I might be able to post up a site so a person could see what I am trying to do. Hi I have a problem where my design does not look the same in 2 browsers for MACS. Netscape 7 MAC OSX 10.3 and Opera 6 MAC OSX 10.3. If you take a look at http://dmumford.bizhat.com/calibre/ you will see what it is supposed to look like. The links below are the MAC screenshots taken from browser cam http://www.bullsigns.com/netscape7-mac-osx-10.3.jpg http://www.bullsigns.com/opera6-mac-osx-10.3.jpg If anyone could help, i would be eternally grateful, as I have never needed to worry about MACS before. Thank you Attached is my html page and my css file. The css is a template i got off ssi-developer. I'm changing it around a bit to fit my needs. The way I have the page now is fine I'm just curious to know if I can do this one thing. What I'm wondering is if I have to make different classes for the multiple rows that I have. Is there a way I can make the same layout without making all the rows. Once you see my files you will get a better understading of what I'm trying to accomplish. Hello, I want need to do the following: div_01 div_02 div_03 div_04 div_05 Do I need to place div_02, div_03 and div_04 inside a div container? Thanks, Miguel |