CSS - Centered Divs Failing To Align Properly.
can anyone tell me why the control div with the links and the div to contain the images for my photo album do not look properly aligned?
link to photo Album can be found here but please note this is a dynamically set IP so is likely to change: http://85.210.107.231/PA.html Similar TutorialsHi everyone, I am bad at this bit and i don't really know why. I have a div and a floated UL. I want the div to sit next to the UL, however, it sits above it and I cannot get them to sit together. Could someone please just post a brief method of getting them to sit side by side and I will try and work it for myself. Thanks. Page is http://www.wellandpower.net im trying to get the menu tabs to line up properly, if you notice they are slightly floating higher than they should and was stuck in trying to figure out how to fix this. here is my css code i used: Code: a:hover#index, a:hover#search, a:hover#ucp, a:hover#members { background: url("./images/home-button.gif") 0 0 no-repeat; background: url("./images/design-and-engineering-button.gif") 0 0 no-repeat; background: url("./images/how-to-rebuild-button.gif") 0 0 no-repeat; background:url("./images/installation-button.gif") 0 0 no-repeat; } a#index, a#design, a#howto, a#articles { width: 77px; height: 28px; float: left; } a#index { background: url("./images/home-gray.gif") 0 0 no-repeat; } a#design { background: url("./images/design-and-engineering-gray.gif") 0 0 no-repeat; } a#howto { background: url("./images/how-to-rebuild-gray.gif") 0 0 no-repeat; } a#articles { background:url("./images/installation-gray.gif") 0 0 no-repeat; } I am trying to get the header image and navigation menus to align in the center. as well as centering the actual menu buttons. here is my sample: http://blurple.net/design/ Here is stylesheet Quote: body {color:#121212; margin:20px 0 0;background:#D3D3D3;} body, p, h1, h2, h3, table, td, th, ul, ol, textarea, input {font-family:Arial, Verdana, Tahoma; font-size:11px; line- height:140%;} /* Class For Headings */ h1 {padding:15px 5px 15px 25px; margin:0; border:1px solid #55B5FF; background:#C0E4FF;} h2 {font-size:18px; color:#394352; padding:15px 0 2px 5px; margin:0 0 5px; color:#7628BD; border-bottom:1px solid #E4DCFF;} h3 {font-size:14px; color:#F26C00; padding:0 0 3px 0; margin:0; text-align:center;} h4 {font-size:13px; color:#3A74B9; padding:0 0 3px 0; margin:0;} h5 {font-size:13px; color:#F26C00;} h6 {font- size:10px; } p {padding:2px 0 12px; margin:0;} ul {padding-top:3px; margin-top:3px;} input.homInp {background:#55B5FF; border:1px solid #fff; color:#fff; height:18px; width:110px; vertical-align:middle; padding:0; margin:0;} input.go {background:url (images/go.gif) left top no-repeat; height:22px; width:24px; border:0; vertical- align:middle; padding:0; margin:0 0 0 3px;} .mainTab {width:917px;} .logo { margin:5px 10px 0; float:left;} .paddmenu {padding:0 6px; background:#fff;} .paddFoot {padding:0 10px 0 25px;; background:#fff;} .paddMid {padding:5px 10px; background:#fff;} .topicon {float:right; margin:35px 20px 5px 0;} .topicon img { vertical-align:middle;} .blueBox {border:1px solid #55B5FF; background:#C0E4FF; padding:0 10px 0 0;} .homBlueBox {border:1px solid #437DCD; background:#C0E4FF; border-top:0; border-bottom:0;} .homBlueBox td { padding:3px 15px 2px 30px;} .homBlueBox td.homBlueBord { padding:0; border-top:1px solid #437DCD;} .homLftBord {border:1px solid #B9B9B9; background:#fff; border-top:0; border-bottom:0;} .homLftBord td { padding:5px; line-height:130%;} .slidetabsmenu{float:center;width:100%;background:url (images/menubg.gif) top repeat-x;} .slidetabsmenu ul{list-style- type:none;margin:0;padding:0;} .slidetabsmenu li{display:inline;margin:0;padding:0;} .slidetabsmenu a{float:center;background:url(images/slide-left.gif) no-repeat left top;margin:0;margin:0;padding:0 0 0 10px;text-decoration:none;BORDER-RIGHT:#D8BCED 1px solid;BORDER-left:#121212 1px solid; line-height:normal;} .slidetabsmenu a.hombord{BORDER- left:0; padding-left:0;} .slidetabsmenu a.contactbord{BORDER-RIGHT:0;} .slidetabsmenu a span {float:left;display:block;background:url(images/slide-right.gif) no-repeat right top;padding:14px 13px 13px;font-size:14px; font-weight:bold; font-family:Tahoma;color:#fff;} /* Commented Backslash Hack hides rule from IE5-Mac \*/ .slidetabsmenu a span {float:none;} /* End IE5-Mac hack */ .slidetabsmenu a:hover span, .slidetabsmenu li.selected a span {color:#fff;text-decoration:none;} .slidetabsmenu a:hover, .slidetabsmenu li.selected a {background-position:0% -125px;text-decoration:none;} .slidetabsmenu a:hover span, .slidetabsmenu li.selected a span{background-position:100% -125px;} html>/**/body .IEonlybr{ /*None IE browsers hack*/display:none; /*Hide BR tag in non IE browsers, since it's not needed*/} /* ######### Style for Drop Down Menu ######### */ .dropmenudiv_c {position:absolute;top:0;border:1px solid #fff; font:normal 13px Tahoma;line-height:18px;z- index:100;background-color:#9449CE;width:200px;visibility:hidden;} .dropmenudiv_c a {width:auto;display:block;text-indent:5px;border:0 solid #fff;border-bottom-width: 1px; /*THEME CHANGE HERE*/padding:2px 0;text-decoration:none;font-weight:normal;color:#fff;} * html .dropmenudiv_c a{ /*IE only hack*/width:100%;} .dropmenudiv_c a:hover{ /*THEME CHANGE HERE*/background-color:#1798FF; color:#fff; text-decoration:none;} .dropmenudiv_c form {background-color:#B174E0; color:#000; padding:0 0 8px; margin:0;} a{color:#1963C0; text- decoration:none;} a:hover{text-decoration:underline;} .footerTxt {color:#7628BD;} .footerTxt a {color:#7628BD;} .middleTxt {padding:12px; font-size:12px;} .middleTxt p {font-size:12px;} .middleTxt td {font-size:12px; line-height:130%;} .middleTxt li {font-size:12px; line- height:130%;} a.readmore {background:url(images/readmore.gif) top left no-repeat;text- decoration:none; float:right; width:85px; height:20px; color:#121212; padding:2px 0 0 10px;} a.readmo hover {text-decoration:underline;} td.boxbgHost {padding: 5px 10px 8px 20px; background:url(images/hostingbg.jpg) bottom left no-repeat; font-size:10px;} .clr {clear:both;} .Tab{font-family: Trebuchet MS, Lucida Sans Unicode, Arial, sans- serif;width:100%;float:left;} .plans-head { font-family:"Trebuchet MS";color:#393939; line- height:28px; border:solid 1px #cdcdcd; font-size:16px; font-weight:bold; padding-left:10px; background:url(images/plans_head_bg.gif) repeat-x #cdcdcd;} #AKD_tab2 {border:1px solid #ccc; margin-left:20px;} .mainTable {width:917px; margin:0 auto; text-align:left; background:#fff;} .menubg {background:#500FA4 url(images/menubg.gif) top repeat-x; font-size:14px;} .footdotbg {background:#fff url(images/foot-dotbg.gif) top repeat-x; height:32px;} .grayheadbg {background:#CDCDCD url(images/grayheadbg.gif) top repeat-x; height:28px; border:1px solid #CDCDCD; border-bottom:0; padding-left:15px; font-size:16px; font- weight:bold; color:#000;} .grayshadbg {background:#fff url(images/grayshadbg.jpg) top right no-repeat; border:1px solid #CDCDCD; border-top:0; padding-left:15px;} .graybg {background:#F2F2F2; border:1px solid #CDCDCD; border-top:0; padding-left:15px;} .headBold {font-size:18px;} .slidetabsmenu{float:center;width:100%;background:url(images/menubg.gif) top repeat-x;} .slidetabsmenu ul{list-style-type:none;margin:0;padding:0;} .slidetabsmenu li{display:inline;margin:0;padding:0;} .slidetabsmenu a{float:left;background:url(images/slide-left.gif) no-repeat left top;margin:0;margin:0;padding:0 0 0 10px;text-decoration:none;BORDER-RIGHT:#D8BCED 1px solid;BORDER-left:#121212 1px solid; line-height:normal;} .slidetabsmenu a.hombord{BORDER-left:0; padding-left:0;} .slidetabsmenu a.contactbord{BORDER-RIGHT:0;} .slidetabsmenu a span {float:left;display:block;background:url(images/slide-right.gif) no- repeat right top;padding:14px 13px 13px;font-size:14px; font-weight:bold; font- family:Tahoma;color:#fff;} /* Commented Backslash Hack hides rule from IE5-Mac \*/ .slidetabsmenu a span {float:none;} /* End IE5-Mac hack */ .slidetabsmenu a:hover span, .slidetabsmenu li.selected a span{color:#fff;text- decoration:none;} .slidetabsmenu a:hover, .slidetabsmenu li.selected a{background-position:0% -125px;text- decoration:none;} .slidetabsmenu a:hover span, .slidetabsmenu li.selected a span{background-position:100% - 125px;} html>/**/body .IEonlybr{ /*None IE browsers hack*/display:none; /*Hide BR tag in non IE browsers, since it's not needed*/} /* ######### Style for Drop Down Menu ######### */ .dropmenudiv_c{position:absolute;top:0;border:1px solid #fff; font:normal 13px Tahoma;line- height:18px;z-index:100;background-color:#9449CE;width:200px;visibility:hidden;} .dropmenudiv_c a{width:auto;display:block;text-indent:5px;border:0 solid #fff;border-bottom -width: 1px; /*THEME CHANGE HERE*/padding:2px 0;text-decoration:none;font- weight:normal;color:#fff;} * html .dropmenudiv_c a{ /*IE only hack*/width:100%;} .dropmenudiv_c a:hover{ /*THEME CHANGE HERE*/background-color:#1798FF; color:#fff; text- decoration:none;} .dropmenudiv_c form{background-color:#B174E0; color:#000; padding:0 0 8px; margin:0;} * SLIDER */ .slider-wrap { width: 930px; /*position: absolute; top: 87px; left: 40px;*/ } .stripViewer .panelContainer .panel ul { text-align: left; margin: 0 15px 0 30px; } .stripViewer { position: relative; overflow: hidden; width: 930px; height: 276px; } .stripViewer .panelContainer { position: relative; left: 0; top: 0; } .stripViewer .panelContainer .panel { float: left; height: 100%; position: relative; width: 930px; } .stripNavL, .stripNavR, .stripNav { display: none; } .nav-thumb { border: 1px solid black; margin-right: 5px; } #movers-row { margin: 0; float: left; } #movers-row div { width: 30px; float: left; } #movers-row div a.cross-link { float: right; } .photo-meta-data { background: url(images/transpBlack.png); padding: 10px; height: 17px; position: relative; z-index: 9999; color: white; } .photo-meta-data span { font-size: 13px; } .cross-link { display: block; width: 23px; padding-top: 8px; z-index: 9999; float: left;} .active-thumb { background: transparent; } #fla_head img {width:917px;position:absolute;top:0;left:0;} #fla_head {width:930px;height:276px;overflow:hidden;position:relative;font-family:Arial, Helvetica, sans-serif, Calibri !important; } #fla_controls {width:917px;height:38px;font-family:Arial, Helvetica, sans-serif, Calibri ! important;} #fla_bgbar a{background:#fff url(images/imgmenubg.jpg) bottom repeat-x;} #fla_pages a{float:left;display:inline;font-size:11px;font-weight:bold;line- height:12px;border:1px solid #2d8ce6; width:28px;text-align:center;padding:2px 0 2px 0;color:#c0cfee;text-decoration:none !important;margin-right:3px;} #fla_pages {padding:11px 0 0 10px;display:block;height:20px;float:left;width:310px;} #fla_pages a:hover, #fla_pages a.active{border:1px solid #db7d0b; color:#fff;} #fla_other_controls {font-family:Arial, Helvetica, sans-serif, Calibri ! important;float:right;width:110px;padding-top:8px;} #fla_other_controls a{float:left;display:inline;font-size:10px;line-height:10px;text- decoration:none !important;color:#fff;text-align:center;padding:5px 0 1px 0;} #pause_scene {width:46px;margin:0 -5px;height:26px !important;} #pause_scene:hover {} #next_scene, #prev_scene {background: url(../images/header/next.png) no-repeat 0 0;width:26px;height:26px !important;} #next_scene:hover, #prev_scene:hover {} Hi, I'm having issues trying to get text to center on a few buttons. Here's the site: http://www.highspeeddirtcheap.com The buttons I'm having problems with are located near the top right, labeled as: Current Deal, How We Roll, and More Deals Moreover, the buttons don't even show up in IE6 or 7. Any ideas of what I'm doing wrong? Thank you. I'm trying to recreate a header that was built using tables. Here is an example of the original header. This is how I want it to look using div. http://65.175.116.253/logo/html_head_p1.html Here is the code for the table based header Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> </HEAD> <body bgcolor="white" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"> <basefont face="verdana"> <table width="780" height="68" border="0" cellpadding="0" cellspacing="0"> <tr> <td bgcolor="#004C91" align="center" valign="center" width="222"><img src="http://65.175.116.253/logo/logo.gif" width="196" height="49" hspace="10"> </td> <td bgcolor="#004C91" align="center" valign="center" width="600"> <img src="http://65.175.116.253/logo/banner.jpg"> </td> </tr> </table> </body> </html> Here is the header using the code with DIVs. http://65.175.116.253/logo/styletest.html Here is the code I have using divs. I'm confused as to how to align the images correctly in the divs... Can someone show me how to correct this? I put the style info in teh same document so it would be easier to read. Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <style type="text/css"> #headerlogo { background: #004C91; position: absolute; width: 222px; height: 68px; top: 0px; padding-left: 0px; padding-right: 0px; } #headerbanner { background: #004C91; position: absolute; width: 600px; height: 68px; top: 0px; padding-left: 50px; padding-right: 0px; } </style> <title>Untitled</title> </head> <body> <div id="headerlogo"><img src="http://65.175.116.253/logo/logo.gif"> <div id="headerbanner"><cfinclude template="banner.cfm"> </body> </html> This is driving me crazy and I can't figure it out. I have a "content" div that is a container for 2 other div's (a sidebar and a main content area). For some reason it isn't rendering in the proper place; it's rendering at the top of the page instead of under the navigation (if I don't assign a height to it it doesn't render at all). It also isn't extending past the end of the other 2 div's to reach the footer. I have tried adding overflow hidden to it but it just makes the other 2 divs not render at all. Any help is greatly appreciated. Here is the HTML and the CSS is below it. 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>CSS Portal - Layout Generator</title> <link rel="stylesheet" type="text/css" href="style.css" /> </head> <body> <div id="wrapper"> <div id="header"> <p>This is the Header</p> </div><!-- /#header --> <div id="navigation"> <ul> <li><a href="#" >Home</a></li> <li><a href="#" >About</a></li> <li><a href="#" >Contact</a></li> <li><a href="#" >Links</a></li> </ul> </div><!-- /#navigation --> <div id="content"> <div id="leftcolumn"> <div class="box_blue"> <div class="box_header_blue">Hello, World!</div><!-- /.box_header_blue --> <div class="box_content_blue"> <ul> <li>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</li> <li>Aliquam scelerisque eros at est lobortis eget adipiscing felis sodales.</li> <li>Sed faucibus hendrerit ante, vitae volutpat tellus suscipit sit amet.</li> <li>Quisque rutrum arcu non ipsum fringilla dapibus.</li> <li>Aliquam aliquam arcu sit amet nisi viverra facilisis.</li> </ul> </div><!-- /.box_content_blue --> </div><!-- /.box_blue --> </div><!-- /#leftcolumn --> <div id="main"> <p>This is the main content</p><br /><br /> <p><a href="layouts/121836.htm"> <img border="0" src="layouts/html.png" width="16" height="16"> HTML File</a></p> <p><a href="layouts/121836.css"> <img border="0" src="layouts/css.png" width="16" height="16"> CSS File</a></p> <p>To download, right click and choose 'Save Target as...'</p> <p> </p> <p>If you use one of these layouts, please consider linking to CSS Portal.<br /> http://www.cssportal.com</p> </div><!-- /#main --> </div><!-- /#content --> <div id="footer"> <p>This is the Footer</p> </div><!-- /#footer --> </div><!-- /#wrapper --> </body> </html> Code: * { padding: 0; margin: 0; } html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td { margin: 0; padding: 0; border: 0; outline: 0; font-size: 100%; vertical-align: baseline; background: transparent; } body { line-height: 1; } ol, ul { list-style: none; } blockquote, q { quotes: none; } blockquote:before, blockquote:after, q:before, q:after { content: ''; content: none; } /* remember to define focus styles! */ :focus { outline: 0; } /* remember to highlight inserts somehow! */ ins { text-decoration: none; } del { text-decoration: line-through; } /* tables still need 'cellspacing="0"' in the markup */ table { border-collapse: collapse; border-spacing: 0; } a{ text-decoration: none; color: inherit; } ul { list-style: none; } body { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13px; background: url('images/bg.png') fixed; } p { padding: 10px; } #wrapper { margin: 0 auto; width: 1000px; } #header { color: #333; height: 200px; background: url('images/header.png') fixed; } #footer { height: 100px; clear: both; color: #333; background: #6B6659; } #navigation { float: left; width: 1000px; height: 35px; color: #333; background: #6B6659; background: #b5bdc8; /* old browsers */ background: -moz-linear-gradient(top, #b5bdc8 0%, #828c95 36%, #28343b 100%); /* firefox */ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#b5bdc8), color-stop(36%,#828c95), color-stop(100%,#28343b)); /* webkit */ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#b5bdc8', endColorstr='#28343b',GradientType=0 ); /* ie */ line-height: 35px; } #navigation li { display: inline; float: left; padding: 0 10px; color: #dddddd; } #content { background: #f6f9fa repeat; color: #545454; margin: 0 auto; box-shadow: 2px 0px 3px rgba(0,0,0,.8), -2px 0px 3px rgba(0,0,0,.8); -moz-box-shadow: 2px 0px 5px rgba(0,0,0,.8), -2px 0px 5px rgba(0,0,0,.8); -webkit-box-shadow: 2px 0px 3px rgba(0,0,0,.8), -2px 0px 3px rgba(0,0,0,.8); position: relative; } #leftcolumn { color: #333; background: #EBE3CD; width: 200px; float: left; padding: .5em; } #main { color: #333; background: #fff; width: 770px; float: right; padding: 8px; } .box_blue { -moz-border-radius: 1.2em 1.2em 1.2em 1.2em; -moz-box-shadow: -1px -1px 1px rgba(0, 0, 0, 0.6); margin: 1.6em 0; } .box_header_blue { background-color: rgb(23, 71, 115); color: rgb(255, 255, 255); font-weight: bold; line-height: 3em; text-align: center; font-size: 1.2em; -moz-border-radius-topleft: 1.2em; -moz-border-radius-topright: 1.2em; border-right: 1px solid rgb(0, 0, 50); border-width: 1px; border-style: solid; border-color: #86B1E3 rgb(0, 0, 50) rgb(0, 0, 50); text-shadow: 1px 1px 1px rgb(16, 16, 16); background-image: -moz-linear-gradient(center top , rgb(45, 90, 141), rgb(71, 93, 167) 50%, rgb(43, 75, 128) 51%, rgb(45, 93, 138)); } .box_content_blue { padding: .5em; background: -moz-linear-gradient(top, #f1f1f1, #fff 75%) #fff; display: inline-block; border-right: 1px solid rgb(0, 0, 50); border-width: 1px; border-style: solid; border-color: rgb(152, 208, 237) rgb(0, 0, 50) rgb(0, 0, 50); -moz-border-radius-bottomleft: 1.2em; -moz-border-radius-bottomright: 1.2em; } .box_content_blue li { padding: 10px 0; border-bottom: 1px dotted #cccccc; } Hi guys. I was trying hard to figure out myself before posting this question on this site: (www dot paintersdirectory.ie/listing/location/leinster/county-longford) there is a "float-right" div ".sidebarSearch". It is hitting left bottom corner of the div "map" above it. I would like my sidebarSearch to be underneath map on the very right. Thank you very much Basically on my main page the left menu and right content divs don't align, i need the rights bit to align with the lefts lower bit. linky -> http://www.gamingonlinux.info/ css that controls them: Code: .left { float: left; width: 152px; } .left_bg { background-image: url(images/left.gif); background-repeat: no-repeat; } .left_bg p { padding-top: 9px; padding-left: 6px; line-height: 150%; } .right { float: right; background-image: url(images/content.gif); background-repeat: no-repeat; width: 748px; } .right p { padding-left: 5px; } I want to be able to have all of these divs align at the top of the wrapper div, but I am a css newbie, and I can't seem to find a way to get it to work. If anyone can help that would be great! here it is Hi, all. I'm brand new to CSS and have run into my first speedbump. I've tried searching the forum already, forgive me if I missed a previously posted solution. Today I put together a page at work and it looked correct in IE8 (which is the only browser we can use at work). When I got home, I discovered that it doesn't display properly in ANY other browser. I've validated my code, and just can't figure out what the problem is. (I tried to link to images here of what it should look like versus what it actually looks like, but apparently as a new user I'm not permitted to post URLs. I also don't seem to be able to insert images into this post, so if anyone would like to see the images, I guess I could email them to you.) Can anyone tell me why the DIVs appear to be too long? Thanks in advance for any help. Here is the HTML: <HTML> <HEAD> <link rel="stylesheet" type="text/css" href="comp.css" /> </HEAD> <BODY> <div id="parent"> <div id="left_top"> </div> <div class="bigcontainer" id="right_top"> a very<br>special<br>place<br>on the<br>internet </div> <div class="container" id="left_mid"> additional reading </div> <div class="container" id="right_mid"> tab one | tab two | tab three | tab four | tab five </div> <div class="container" id="left_bottom"> first link<br> second link<br> third link<br> fourth link<br> fifth link<br> sixth link<br> seventh link<br> eighth link<br> </div> <div id="right_bottom"> <p> Lorem ipsum dolor sit amet... </p> </div> </div> </BODY> </HTML> Here is the CSS: body { font-family: sans-serif; font-size: 10px; margin: 0; padding: 0; background-color: #e5e5e5; } div.bigcontainer { font-size: 20px; font-weight: bolder; vertical-align: middle; padding: 20px 20px 0px 0px; text-align: right; } div.container { font-size: 12px; font-weight: bolder; vertical-align: middle; padding: 10px 20px 5px 0px; text-align: right; } #parent { margin: 0px; padding: 0px; position:relative; } #left_top { width: 35%; height: 190px; background-color: #7d7d7d; float: left } #right_top { width: 65%; height: 190px; color: #ffcc00; background-color: #666666; float: right; } #left_mid { width: 35%; height: 35px; color: #ffff99; background-color: #ffd426; float: left; } #right_mid { width: 65%; height: 35px; color: #666666; background-color: #ffcc00; float: right; } #left_bottom { width: 35%; height: 100%; padding: 20px; color: #999999; text-align: right; background-color: #e5e5e5; float: left; } #right_bottom { width: 65%; padding: 20px; color: #666666; text-align: right; background-color: #ffffff; float: right; } I have nested divs and on the most outer div i apply a background-color but it is only applied to half of the divs?? it happens BOTH in firefox & IE!! PHP Code: <style type="text/css"> /********** layout of the page ***********/ #top { background-color:yellow; clear:both; } /***************** Formatting top part of the page **************/ #tag { float:left; margin-left:8em; } #login { float:right; } #logo { margin-left:2em; float:left; clear:left; } #searchBox { float:right; clear:right; } #links2 { clear:right; background-color:yellow; } #links2 li{ font-size:0.8em; display:inline; float:right; text-decoration:none; list-style:none; padding:1em; } </style> </head> <body> <div id="top"> <div id="tag"> <p id="">Zahra Zahra Ltd</p> </div> <div id="login"> <p>Login/Register</p> </div> <div id="logo"> <a href="index.php"><img src="images/site/zahra.jpg" width="65" height="59" /></a> </div> <div id="searchBox"> <form action="search.php" method="post" style="margin:0em; padding:0em;"> <label>What are you shopping for?</label> <input type="text" name="search" value="search" size="14"/> <input type="submit" name="submit" value="Go" /> </form> </div> <div id="links2"> <ul> <li>Contact Us</li> <li>Testimonial</li> <li>Return Policy</li> <li>News</li> <li>FAQ</li> <li>about us</li> <li>Home</li> </ul> </div> </div> i really need to vertical align a div to always be at the bottom of a main div... Code: <div class="container"> <div class="menu"></div> </div> i want .menu to always be at the bottom of .container .... no matter the height of the container div I am trying to get a row of mixed divs to align horizontally center on the page. I would also like to move the Google Checkout logo up a bit so it is vertically centered relative to the logos on that row. Can you help me do these things? TIA! I've tried doing a lot of things including profanity but no go. The screenshot below is how the page looks now with this css: Code: .row div { height:75px; float:left; } #AuthorizeNetSeal,#googleCheckoutLogo,#paypal { margin-top:25px; } Code: <div class="row"> <!-- (c) 2005, 2011. Authorize.Net is a registered trademark of CyberSource Corporation --> <div class="AuthorizeNetSeal"> <script type="text/javascript" language="javascript">var ANS_customer_id="xxxxxxxx";</script> <script type="text/javascript" language="javascript" src="//verify.authorize.net/anetseal/seal.js" ></script> <a href="http://www.authorize.net/" id="AuthorizeNetText" target="_blank">Online Payment Service</a> </div> <img src="http://www.hotscripts.com/forums/images-manual/small_cc_icon_discover.gif" > <div><!-- Begin Official PayPal Seal --><a href="https://www.paypal.com/us/verified/pal=xxxxxxxxxxx" target="_blank"><img src="https://www.paypal.com/en_US/i/icon/verification_seal.gif" border="0"></A><!-- End Official PayPal Seal --></div> <div id="googleCheckoutLogo"></div><script src='https://checkout.google.com/buttons/logos?merchant_id=xxxxxxxxxxxx&loc=en_US&f=png' ></script> <span id="siteseal"><script type="text/javascript" src="https://seal.godaddy.com/getSeal?sealID=xxxxxxxx"></script></span> <img src="http://www.hotscripts.com/forums/images-manual/100satisguar80x79.gif"> </div> Here's what it looks like now: i've heard talk of text-align wrapper hacks, or just plain using tables... i got my main container div to align center by setting it to "margin:auto" but that code doesnt work for the divs inside that div.... can you please help me out... cuz i dont even know what the text-align hack is... i just have heard of it/ Hey, I use div's to create my page structure (you can see it on the screenshot) http://img144.imageshack.us/img144/...tructurege3.jpg The green part is the navigation and the blue part the contents of the page. But as you see the colors both dont fill up till the bottom of the document. And if i set: height: 100%; then it will fill up to the bottom, but when the contents gets to big and a scrollbar is needed, then the part that you scroll down is not filled up with the colors anymore. Does anybody know how to fix this? Thanks in advance. Hi, just a quick question. Say I have two input buttons (Just like the submit post/preview post buttons at the bottom of the forms). Code: <input type="submit" value="blah" /> <input type="submit" value="lol" /> If I want to align them in the center of the row that they're on, I've had to wrap them in a <div> with the text-align: center attribute on the div. Is there anyway to accomplish this same purpose without having to use wrapper <div>s? I am trying to make to div tags enclosed inside another div tag align horizontally. I am trying to do this without absolute positioning. See image below Any ideas? Thank you. I've been having problems trying to vertically align an image within a div. I'm trying to align it to the bottom of the div. CSS as follows: #col1r1 { float: left; height: 40%; width: 33%; display: inline; text-align: right; } div#col1r1 div#image { bottom: 66%; left: 60%; color: black; vertical-align: bottom; } div#col1r1 div img.pagegr { width: 60%; } HTML: <div id="col1r1"> <div id="image"><img class="pagegr" src="images/blah.gif" alt=""></div> </div> Unfortunately this code will be appearing on multiple pages with a different image on each page - some portrait, some landscape, and of varying sizes - otherwise, I would have added some blank space to the top of image itself to make it fit and sit nicely aligned with the bottom of the box. I'd really appreciate some help. Thanks in advance. I am having a little difficulty with aligning two divs. I have one 800 wide div that has the site content...it needs to be centered at all times. The second div is 160 wide and I want it at the same height as the first, but ten pixels to its right. This image should visually show it: I have tried absolute position 50% 0% for the first with the second as relative..and it overlays it...treid different combinations of float as well. What am I doing wrong? Thanks in advance I cannot figure this out. I've tried adding clear: both in several places, I've tried overflow: hidden and I've tried cursing. Nothing works! How can this be fixed so that in IE6 the divs are not staggered vertically?? Code: <div style="height: 38px; margin: 0px; padding: 0px; width: 140px;"> <div style="float: left; height: 38px; width: 38px;"><img style="border: 1px solid #444444; vertical-align: middle" src="http://www.diversifieddesigns.com/GRAPHICS/Spacer.gif" alt="" width="38" height="38" border="0"></div> <div style="float: right; height: 38px; width: 102px;">copy</a><br>copy</a></div> </div> <div style="height: 38px; margin: 0px; padding: 0px; width: 140px;"> <div style="float: left; height: 38px; width: 38px;"><img style="border: 1px solid #444444; vertical-align: middle" src="http://www.diversifieddesigns.com/GRAPHICS/Spacer.gif" alt="" width="38" height="19" border="0"></div> <div style="float: right; height: 38px; width: 102px;"><img style="border: 1px solid #444444; vertical-align: middle" src="http://www.diversifieddesigns.com/GRAPHICS/Spacer.gif" alt="" width="38" height="8" border="0"></div> </div> |