CSS - Move Containers To The Right
Similar Tutorialsi am working for a client that is strict on making sure that all code is up to standards. the question i have is, how can i use the same class container twice in the same page and have everything up to standards? the catch is the doctype has to be XHTML 1.0 Transitional and i can't have the same id twice on the page. i'd hate to make 2 classes for the same style. any suggestions? Code: <ul id="headerfooter"> <li><a href="link1.html">header link 1</a></li> <li><a href="link2.html">header link 2</a></li> <li><a href="link3.html">header link 3</a></li> </ul> Code: <ul id="headerfooter"> <li><a href="link1.html">footer link 1</a></li> <li><a href="link2.html">footer link 2</a></li> <li><a href="link3.html">footer link 3</a></li> </ul> Hi, I need help with a container div. Something is screwy in the way I have nested my divs and I think it has something to do with position: relative or absolute. I get the difference between the two, but not the relationship. Can someone tell me what I'm doing wrong? http://idiaonline.com/websites/taz/index.php Code: <div id="container"> <div class="logo"></div><div class="top"></div> <div class="navline"></div> <div class="navbar"> <div class="navsquare"><img src="images/faq.gif" alt="Taz Limousine Service Policy" width="43" height="41" /><br />F.A.Q.</div> <div class="navsquare"><img src="images/fleet.gif" alt="Our Vehicles" width="43" height="41" /><br />Fleet</div> <div class="navsquare"><img src="images/contact.gif" alt="Contact Us" width="43" height="41" /><br />Contact</div> <div class="navsquare"><img src="images/maps.gif" alt="Maps & Directions" /><br />Maps</div> </div> <div class="content"> <div id="left"> <div class="about"> <p><br /> <br /> Taz Limousine is dedicated to dependable,courteous and quality service for business or personal transportation at competitive pricing. In order to achieve that goal in a secure and comfortable environment we rely on experienced chauffeurs and well maintained vehicles that meet city, state and federal regulations. Thank you for considering Taz Limousine Service.</p> <p> </p> <div class="weather"> <div align="center"> <br /> <p></p> </div> </div> <div style="float:right; width:150px;"><br /><br /> <h2> Atlanta, GA</h2> </div> </div> </div> <div id="mid"> <div class="rotate"><img src="images/rotate/rotate.php" alt="Limousine Service Atlanta" /></div></div> <div id="right"><div class="special"> <h1> Reserve A Limo Today!</h1> </div></div> </div> </div> and css Code: body, html { font-family:Arial, Helvetica, sans-serif; color:white; height:100%; margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; } a:link { color: #FFFFFF; text-decoration: none; font-weight:bold; } a:visited { text-decoration: none; color: #0066FF; } a:hover { text-decoration: underline; color: #0000FF; } a:active { text-decoration: none; color: #FFFFFF; } #container { width:800px; margin: 0px auto; position:relative; background:#000033; border: thin #0000ff solid; } .top { height: 108px; width: 800px; position: absolute; left: 0px; top: 0px; background-image:url(images/gradient.jpg); background-repeat: repeat; z-index: 2; } .logo { background-image: url(images/taz-logo.gif); background-repeat: no-repeat; background-position:top; height: 60px; width: 305px; left: 0px; top: 25px; z-index:4; position:absolute; } .navline { background-image: url(images/blk-gradient.jpg); background-repeat: repeat-x; position: absolute; height: 42px; width: 100%; left: 0px; top: 108px; z-index: 3; } .content { background:#000033; position: absolute; height: 100%; width: 100%; left: 0px; top: 0px; z-index: 1; border:solid #0000ff thin; } .navbar { position: absolute; height: 60px; left: 60%; top: 75px; z-index: 15; width:288px; } .navsquare { position:relative; float:left; height:60px; width:72px; background-image:url(images/nav-square.gif); background-repeat:no-repeat; text-align:center; font-size:9px; font-style:italic; } .about { position:relative; left:5%; top:40%; background-image:url(images/about_taz_limousine.gif); background-repeat:no-repeat; width:225px; height:150px; font-size:10px; padding-left:25px; z-index:4; } .rotate { position:relative; top:10%; z-index:3; } .weather { position:absolute; background-color:#000033; top:159px; background-image:url(images/weatherbox.jpg); background-position:left; background-repeat:no-repeat; height:81px; width:94px; left: 6px; } .special { background-image:url(images/special.gif); width:271px; height:88px; position:absolute; text-align:center; top:15%; } #left { float:left; position:relative; top:200px; width:35%; z-index:50; } #mid { float:left; position:relative; top:175px; width:35%; } #right { float:left; position:relative; top:200px; height:300px; width:30%; z-index:30; } h2 { font-size:15px; } h1 { font-size:18px; font-variant:small-caps; } I have partially succeeded in making a table of products that changes column number depending on page width. The magic of DIVs. It's been a dream of mine . LOL. Problem is I can't figure out how to center the shown container objects in each row. So, unless the width of your browser is just right, everything ends up off-center. (http://www.harpgallery.com/showroomdetail/cat_id/4/) I've been looking at how Newegg does it, but I just can't figure out what they've done to get their containers to dynamically resize and float like they do. It's a work of CSS art for sure. I snipped out the code I'm using to make the page. I was hoping some of you here would have some ideas? Thanks! Code: --The HTML-- <table border='0' cellpadding='2' cellspacing='2' bgcolor='#000000' width=100%> <tr><td> <div id='HomepagePrd'> <div class='Section'> <div class='product'> <div class='prodImage'><a href='Product URL'><img Border='0' src='Image URL' height=150 align='top' /></a> </div> <div class='desc'> <h3><a href='$PDurl' ><font color=white face=georgia,arial>Product Name</font></a></h3> </div> </div> </div> </div> </td></tr> </table> --The CSS-- #HomepagePrd{width:100%;clear:both;min-width:472px;} .Section{float:left;width:240px;} .product{ position:relative; width:100%; margin:5px 2px 2px 5px; height:180px; } .prodImage{text-align: center;position:relative;width:100%;} .desc{position:relative;width:100%;margin:0px;padding:0px;} .desc h3{text-align: center;font-size:12px;margin:0px;padding:0px;} Thanks for taking the time to read my question. I have two containers that I want to line up at the top. I can't seem to make them line up. I have a picture inside a <div>, then I have a paragraph. It works in IE7, but in FF, the <p> appears under the picture. If I put a width on the <p> it moves up, but never up all the way so that it is inline with the picture. I'm stumped and not sure what to do. I tried putting display:inline; on either classes, and on both classes at the same time. Not sure what else to do. If I put a width on the <p>, it looks like this in FF |------| |Icon | |---------------------------| |------| | ElevatorSpeech ES2..........| .............|---------------------------| It looks like this if I have no width on <p> |------| |Icon | |------| |---------------------------| |ElevatorSpeech ES2...........| |---------------------------| HTML: Code: <div class="ESContainer"> <p class="Title1">Control</p> <div class="Icon"><img src="Images/Remote.jpg" align="Zone All Control Remote Control" /></div> <p class="ElevatorSpeech ES2">Control your surroundings with confidence, get the results you deserve.</p> <p class="ElevatorFull"><span class="EFLargeText">Zone-All</span> has been manufacturing room comfort temperature controls for more than two decades. Its variable air volume and variable temperature solutions for zone controls are applicable to heating and cooling systems that are designed using both incremental HVAC units and central station air handlers.</p> </div> CSS: Code: .Icon { float: left; margin-left: 10px; padding: 0px; height: 100px; background-color:#FF0000; } .ElevatorSpeech { font-size: 19px; margin-left: 10px; margin-right: 10px; float: left; padding: 0px; /*width: 225px;*/ background-color:#FFFF00; } Thanks, Brad I am so glad that I found somewhere where I might be able to get some help! Currently brain is running so hot its close to seizing or exploding! I have a page design which has three columns each of which has a number of divs within it and a footer all contained within an empty_centre div. Each of the three columns has a container sidebarContainerLeft, midContainer, sidebarContainerRight and all of these are in a contentContainer. So, when filled with content the sidebarContainerLeft and sidebarContainerRight are correctly increasing the height of the contentContainer and the footer is correctly positioned. However when the content in the midContainer exceeds the height of sidebarContainerLeft and sidebarContainerRight the contentContainer is not increasing in height and the footer overlaps the contents of the midContainer! I am completely stuck and wondered if someone could help me!! results with skitch can be seen he - good www.rcm01.f2s.com/tmp/GoodRight.html.jpg good www.rcm01.f2s.com/tmp/GoodLeft.html.jpg bad www.rcm01.f2s.com/tmp/BadMiddle.html.jpg html:- Code: <body> <!-- This is 'empty_center' --> <div id="empty_centre" > <div id="contentContainer" > <div id="midContainer"> <div id="content" class="textcontent" > Main content goes here </div> <div class="clear"></div> <div id="content2" class="textcontent" > Another content set goes here </div> </div> <div id="sidebarContainerLeft" > <div id="phonebar" > phone number </div> <div id="adbar1" > advert 1 </div> <div id="adbar2" > advert 2 </div> </div> <div id="sidebarContainerRight" > <div id="twitter" > twitter posts go here </div> <div id="newsletter" > newsletter signup goes here </div> </div> <div class="clear"></div> <div id="footer" class="textcontent" > footer goes here </div> </div> </body> </html> css:- Code: #empty_centre { position: absolute; top: 20px; left: 50%; width: 940px; margin-left: -470px; height: auto; z-index: 1; } .clearpad { width: 100%; height: 65px; margin: 0 0 -1px; clear: both; } .clear { clear: both; } /* Page */ #contentContainer { border-style: dotted; height: auto; position: absolute; width: 940px; } #midContainer { float: left; border-style: dotted; position: absolute; left: 190px; width: 460px; } #content { position: relative; background-image:url('./opaquefiller.png'); padding-right: 10px; width: 400px; margin-left: 20px; padding: 10px 10px 10px 10px; } #content2 { position: relative; background-image:url('./opaquefiller.png'); width: 400px; height: auto; margin-left: 20px; margin-top: 10px; padding: 10px 10px 10px 10px; } #reviews { position: relative; background-image:url('./opaquefiller.png'); margin-top: 10px; padding-right: 10px; width: 490px; padding: 10px 10px 10px 10px; margin-left: 10px; } /* Sidebar */ #sidebarContainerRight { border-style: dotted; position: relative; float: right; width: 270px; } #sidebarContainerLeft { border-style: dotted; position: relative; float: left; width: 180px; } #phonebar { background-image:url('./opaquefiller.png'); position: relative; width: 160px; min-height: 30px; height: auto; padding: 10px 10px 10px 10px; } #adbar1 { background-image:url('./opaquefiller.png'); position: relative; width: 160px; height: auto; margin-top: 10px; padding: 10px 10px 10px 10px; } #adbar2 { background-image:url('./opaquefiller.png'); position: relative; width: 160px; height: auto; margin-top: 10px; padding: 10px 10px 10px 10px; } adbar3 { background-image:url('./opaquefiller.png'); position: relative; width: 160px; height: auto; margin-top: 10px; padding: 10px 10px 10px 10px; } #twitter { background-image:url('./opaquefiller.png'); position: relative; width: 210px; height: auto; padding: 10px 10px 10px 10px; } #newsletter { background-image:url('./opaquefiller.png'); position: relative; width: 210px; min-height: 150px; height: auto; margin-top: 10px; padding: 10px 10px 10px 10px; } /* Footer */ #footer { position: relative; background-image:url('./opaquefiller.png'); margin-top: 10px; width: 940px; height: auto; z-index: 3; } Please take a look at a site I'm developing: http;//www.b4itwascool.com The CSS is he http://www.b4itwascool.com/css/main.css I'm also using a Lightbox 2.0, so that CSS is he http://www.b4itwascool.com/css/lightbox.css 1. There is a lot of extra space below the footer. I assume this is where the containers would have been had I not relatively repositioned them? How do I remove this space? 2. I want the right "steel" beam to repeat-y to the bottom of the page. I don't know why that's not working. 3. If you click the top links, you will see that sometimes the footer falls within the left "column", and sometimes it falls within the right column. How do I ensure it always falls to the right, like the way it appears on the homepage? thanks for any advice! Hi, i need a bit of help here.. i got my page up and running perfectly on FF but as for IE7.. well it does load! I have problems with the right menu, the div's i use as containers are not working as they suppose to do. plz see for youself www.soyunapendeja.com.ar can i get a litle help here? Thank you. When I am floating two containers or images my background color disappears. Why is that and what should I do instead? Here is what I am doing: <div class="contentWrapper"> <div class="content"> <div class="leftContent"> <img src="" alt="" /> </div> <!-- end leftContent --> <div class="rightContent"> <img src="" alt="" /> </div> <!-- end rightContent --> </div> <!-- end content --> </div> <!-- end contentWrapper --> Now the css: .contentWrapper { margin: 0; padding: 0; width: 100%; } .content { margin: 0 auto; padding: 0; width: 960px; background: #ccc; } .leftContent { margin: 0; padding: 0; width: 450px; float: left; } .leftContent img { margin: 0; padding: 0; width: 200px; height: 200px; border: #000 solid 1px; } .rightContent { margin: 0; padding: 0; width: 450px; float: right; } .rightContent img { margin: 0; padding: 0; width: 200px; height: 200px; border: #000 solid 1px; } Thanks! If you are getting results as in the above image, simply add "clear:both;" to the container (blue) div which you do not want affected and it will flatten its ceiling and stop any float's escaping. -Luke Hi all 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" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>untitled</title> </head> <body> <table style="margin-bottom: 10px;" cellspacing="0" cellpadding="0"> <tr> <td>asdf</td> </tr> </table> <p style="margin-top: 10px;">asdf</p> </body> </html> Why do the margin-bottom of the table and the margin-top of the p not collapse (only tested in Firefox2)? Why is there 20px between them? I don't understand the world of margins anymore... Is this an exception or a bug or what? Thanks for help, Josh Hello all. I've got a layout with three columns. The first column contains the navigation and the second two are variable content. All the columns can be any length, and consist of any number of divs; each div is a bordered block of variable-sized content. The problem is if I want to float an image around some text in the second or third column. Since the image is floating, its container doesn't extend fully, and the image overlaps the border and the block below it. However, if I put a "clear: both" spacer within the block, then the container clears elements in the left or right columns, and extends way too far down! What I really need is a way to just clear a single level of nesting, but "clear" seems to be pretty much all or nothing. I've also tried the pseudoclass :after trick to extend the box, but that didn't appear to do any good. It just added the content inside the border of each block, but doesn't enclose the image at all. I hope somebody has suggestions - I actually haven't found anything about this problem, but perhaps I'm just looking for the wrong terms. It seems like a fairly fundamental thing to do... Thanks! On this page: http://lfswear(dot)com/sites/lfs2/index.php?main_page=product_info&cPath=1&products_id=8 I can't seem to get the "Size" div to move over right to match up with the color one... Any help would be greatly appreciated. Hi, Am editing a template within dreamweaver as it saves a lot of time for me but I can figure out how to move the right nav bar down. Am trying to include a screenshot but i can't figure out how as I am a new user and it won't let me link.. Basically, it is a two column layout with a picture under the heading and the nav bar up to the height of the picture. Am looking to expand the picture out right and center meaning the nav bar will have to come down just below the picture if you know what i mean? I have tried with design view, won't let me. Had a look at the code but nothing really there that I picked up on (considering am only a beginner).. any thoughts? http://members.cox.net/sherry72/index.html that is my website. I have a stats box to the right but i want it exactly to the right of my content box. It is underneath right now. How do i change the css to make it like i want it? Hi, I am trying to get image on the bottom right hand side of the page to align with the chart in the middle. I have it floated to the right, but I can't seem to make it move up vertically. Not sure how to do this, absolute positioning is not an option because it will be stuck there regardless of browser size. this is where the img is now, see how it is not lined up? URL this is where it is supposed to go. URL my code is this Code: <div style="float:right; vertical-align:baseline;"><img src="/free-gold-charts/gold.png" alt="Free Interactive Gold Charts" width="320" height="290" align="top"/></div> and I have it next to the code for the chart. Help! I'm trying to make a menu using only css basically when you hover over an li element if there is another level below it a div is moved into place to reveal the links. It is working for the top level, but I can't figure out why it won't display/work for the 3rd tier. Both the css and the html validated, a link and the code is below. Thanks for any advice. edit: I can't actually post the link but I will PM it to anyone who wants to see it halfway working. HTML: ------------------------- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "edit:no links"> <html> <head> <title>Test Page for drop menu</title> edit:there would be an include for the css here but I can't post anything resembling a link </head> <body> <div id="menuHolder"> <ul> <li><a href="#url">Advising Network</a> <div class="subHolder"> <ul> <li><a href="#url">Student PASSPort</a> <div class="bottom"> <ul> <li><a href="#url">Test 1</a></li> <li><a href="#url">Test 2</a></li> <li><a href="#url">Test 3</a></li> <li><a href="#url">Test 4</a></li> </ul> </div> </li> <li><a href="#url">Adivsor PASSPort</a> <div class="bottom"> <ul> <li><a href="#url">Test 1</a></li> <li><a href="#url">Test 2</a></li> <li><a href="#url">Test 3</a></li> </ul> </div> </li> <li><a href="#url">Form Bank</a></li> <li><a href="#url">Timeline</a></li> <li><a href="#url">Videos</a></li> <li><a href="#url">Contact</a></li> </ul> </div> </li> <li><a href="#url">Career Investigations</a> <div class="subHolder"> <ul> <li><a href="#url">Student</a> <div class="bottom"> <ul> <li><a href="#url">Test 1</a></li> <li><a href="#url">Test 2</a></li> <li><a href="#url">Test 3</a></li> <li><a href="#url">Test 4</a></li> </ul> </div> </li> <li><a href="#url">Alumni</a></li> <li><a href="#url">Parents and Family Members</a></li> <li><a href="#url">Employers</a></li> <li><a href="#url">eRecruiting</a> <div class="bottom"> <ul> <li><a href="#url">Test 1</a></li> <li><a href="#url">Test 2</a></li> </ul> </div> </li> </ul> </div> </li> <li><a href="#url">Campus Life</a> <div class="subHolder"> <ul> <li><a href="#url">Student and University Life</a></li> <li><a href="#url">Student Activities</a></li> <li><a href="#url">Commuter Services</a></li> <li><a href="#url">Community Service Learning</a></li> <li><a href="#url">USM Partnership with STRIVE U</a></li> <li><a href="#url">USM Calendar of Events</a></li> </ul> </div> </li> <li><a href="#url">Scholarships and Finances</a></li> <li><a href="#url">Academic Success</a> <div class="subHolder"> <ul> <li><a href="#url">Academic Strategies</a></li> <li><a href="#url">Courses</a></li> <li><a href="#url">Additoinal Support Resources</a></li> </ul> </div> </li> <li><a href="#url">Major Discovery</a> <div class="subHolder"> <ul> <li><a href="#url">Being Undeclared</a></li> <li><a href="#url">GO Program</a></li> <li><a href="#url">Aspirations - Early Study</a></li> <li><a href="#url">Choosing Your Major</a></li> <li><a href="#url">FAQ</a></li> </ul> </div> </li> <li><a href="#url">Orientation</a></li> </ul> </div> </body> </html> CSS ------------------- a {text-decoration:none; color:#ffffff;} #menuHolder {height:60px; background:#0072ad; position:relative; text-align:center; width:1000px; font-size:16px; margin:0px;} #menuHolder ul {list-style:none;} #menuHolder ul li {float:left; padding:0px 10px 0px 10px; line-height:60px;} .subHolder {position:absolute; left:0px; top:200px; overflow:hidden; font-size:14px; background:#0083ad;} #menuHolder ul li:hover .subHolder {left:0px; top:60px; width:1000px; text-align:center; height:60px;} #menuHolder ul li:hover {background:#0083ad;} /* sub menu */ .subHolder ul {list-style:none;} .subHolder ul li {float:left; padding:0px 10px 0px 10px; line-height:60px;} .bottom {position:absolute; left:0px; top:500px; overflow:hidden; font-size:12px; background:#0094ad;} .subHolder ul li:hover .bottom {left:0px; top:120px; width:1000px; height:60px; text-align:center; line-height:60px;} .subHolder ul li:hover {background:#0094ad;} /*bottom level*/ .bottom ul {list-style:none;} .bottom ul li {float:left; padding:0px 10px 0px 10px;} Hi I am creating a new site for a friend in Wordpress ilovelifebecause.com I can usually muddle through in css to make changes, but i'm stumped at the moment. What I am trying to do is swap around the two cream coloured boxes so the larger one is on the right, the thinner one on the left and the blue box in the middle still. I've tried a number of things in the css file but can't seem to find the right method - can anyone help? many thanks in advance Paul sorry I posted it again by mistake.. please delete Hi all, Helping out a buddy, but am stuck myself. Possibly simple fatigue. At this site, I'd like to move the entire center container up so that it's only about 20px below the very top. As of right now, when I do this, the top BG image disappears. As you can see from the CSS, there's actually two BG images. I don't want that, I merely want the center container to cover the BG. How, please? Thanks! Chris |