CSS - Help W/image Header Alignment
Okay, I'm no newbie on using CSS but the long story short is that I bought software for a shopping cart and had to use their pre-made template in order to keep the peace. I of course, being a web designer changed the template to my own liking, but can NOT get this header centered for the life of me! I have tried everything I know, including things I have looked up, nothing will work.
Here is the main.css (only css file being used) Code: body { color: #ffffff; background-color: #000000; font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: normal; text-align: left; margin:auto; text-align:center; margin:0 auto; } a { color: #d92f2f; font-weight: normal; text-decoration: underline; cursor: pointer; } p { margin: 0px 0px 7px 0px; } sup { display: inline; padding: 0px; vertical-align: super; font-size: 8px; } a:hover { color: #ffb4b4; } legend { display: none; } label { display: none; } fieldset { border: none; padding: 4px 0px 4px 5px; } fieldset p { display: block; margin: 5px 5px 5px 2px; } form { margin: 0px 0px 5px 0px; } img { border: none; } li { padding-bottom: 5px; } /* +------------------------------------------------------------+ */ /* | General XHTML Classes | */ /* +------------------------------------------------------------+ */ .center { text-align: center; } .inlinecenter { text-align: center; } p.inline { display: inline; padding: 0px; } .strong { font-weight: bold; } .big { font-weight: bold; font-size: 16px; } .hidden { display: none; } a.unfancy { color: #d92f2f; font-weight: normal; text-decoration: underline; cursor: pointer; } /* +------------------------------------------------------------+ */ /* | Skin Specific Divs | */ /* +------------------------------------------------------------+ */ #skin_header { height: 230px; width: 899px; margin:auto; padding: 0px; background-position: center top; } #skin_wrapper { width: 910px; padding: 0px; margin:auto; } #skin_wrapper_full { width: 100%px; padding: 0px; margin:auto; background-image: url('../media/header.png') background-repeat: repeat-x; background-position: top left; } #skin_ct { width: 100%; padding: 0px; margin: auto; border-spacing: 0px; border-collapse: collapse; } #skin_ct_lcol_head { font-size: 16px; font-weight: bold; padding: 10px; margin: auto; width: 160px; height: 80px; } #skin_ct_rcol_head { font-size: 16px; font-weight: bold; padding: 10px; margin: auto; height: 80px; text-align: right; } #skin_ct_lcol { padding: 20px 10px 10px 10px; margin: 0px; vertical-align: top; width: 160px; text-align: left; } #skin_ct_mcol { padding: 20px 10px 10px 10px; margin: 0px; vertical-align: top; line-height: 150%; } #skin_ct_rcol { padding: 2px 10px 10px 10px; margin: 0px; vertical-align: top; width: 160px; } #skin_footer { color: #FFFFFF; background-color: #000000; padding: 50px 10px 10px 10px; margin: 0px; text-align: center; background-image: url('../media/footer.png'); background-repeat: repeat-x; background-position: top left; } #skin_pgtitle { font-size: 16px; padding: 0px 0px 4px 0px; margin: 0px 0px 10px 0px; font-weight: bold; border-bottom: 1px solid #999999; } #skin_content { margin: auto; } There is more coding but the actual image header is located inside of the #skin_header. Also, here is the PHP code where the SRC code is located: Code: </head> <body> <div id="skin_header" align="center"> <img src="skins/Default/media/logo.png" alt="Home" width="899" height="230" align="center" style="margin:auto;"/> </div> <div id="skin_wrapper_full"><div id="skin_wrapper"> <table id="skin_ct"> <tr> <td id="skin_ct_rcol_head" colspan="3"> <div id="skin_menu_head"> <ul> <?php if (!(empty($link_home))) {print '<li><a href="' . $link_home . '" title="Home">Home</a></li>';} if (!(empty($link_cart))) {print '<li><a href="' . $link_cart . '" title="Shopping Cart">Shopping Cart</a></li>';} if (!(empty($link_checkout))) {print '<li><a href="' . $link_checkout . '" title="Checkout">Checkout</a></li>';} if (!(empty($link_account))) {print '<li><a href="' . $link_account . '" title="Your Account">Your Account</a></li>';} if (!(empty($link_contact))) {print '<li><a href="' . $link_contact . '" title="Contact">Contact</a></li>';} ?> </ul> Please, ANY help would be appreciated, I want to get this site live, pronto. The link is www.PhantomSupplements.net thank you! Similar TutorialsI'm trying to get something that looks like this: Here is the xhtml: Code: <div id="container"> <div class="design_box"> <img src="images/image.png" alt="" /> <h1>Header goes here</h1> <p>Paragraph goes here</p> </div> <div class="design_box"> <img src="images/image.png" alt="" /> <h1>Header goes here</h1> <p>Paragraph goes here</p> </div> <div class="design_box"> <img src="images/image.png" alt="" /> <h1>Header goes here</h1> <p>Paragraph goes here</p> </div> </div> Here is the relevant css: Code: .design_box { display: block; margin-bottom: 17px; } #row_a_right_web_design img { float: left; } .design_box h1 { color: #fbfbfb; font: bold .9em Tahoma, arial, sans; margin-bottom: 4px; } .design_box p { color: #c4c2c2; } Needless to say, the above css does not produce the desired outcome. I'm having a serious brain-fart as to what the best way is to tackle this. Thanks in advance. Every div was aligned correctly until I added gallery-wrapper and tried to position it on empty blue space on the left under the menu div. Now its a mess. http://aysetunceltaste.refinethetaste.com header html Code: <div id="wrapper"> <div id="header"> <div class="callus"> <p> Ayse Taste - PO Box 373 - Westfield, New Jersey 07090 <br /> <a href="mailto:info@aysetaste.com">info(AT)aysetaste(DOT)com</a> </p> <h3>1 973 563 0870</h3> </div> <div id="menu"> <ul class="lamp"> <li><a href="default.asp">HOME</a></li> <li><a href="#">ABOUT AYSE</a></li> <li><a href="#">RECIPES</a></li> <li><a href="menus.asp">MENUS</a></li> <li><a href="#">CATERING</a></li> <li><a href="#">CONTACT US</a></li> </ul> </div> <style> #header #gallery-wrapper { float:left; width:350px; height:120px; overflow:hidden; } #header #gallery-wrapper .gallery-pagination { float:left; } #header #gallery-wrapper .gallery-more { float:left; } </style> <div id="gallery-wrapper"> <div class="gallery-pagination"> <a href="#" class="prev">Previous</a> <a href="http://eisabainyo.net/demo/images/image2.jpg" class="next" title="Harbour Bridge" rel="2">Next</a> <span>Photo <span class="current-pos"></span> of <span class="total-pos"></span></span> </div> <div class="gallery-more"> <ul> <li><a href="http://eisabainyo.net/demo/images/image1.jpg" title="Opera House" class="t1 active"><img src="http://eisabainyo.net/demo/images/thumb1.jpg" width="60" height="50" alt="Opera House" /><span>Opera House</span></a></li> <li><a href="http://eisabainyo.net/demo/images/image2.jpg" title="Harbour Bridge" class="t2"><img src="http://eisabainyo.net/demo/images/thumb2.jpg" width="60" height="50" alt="Harbour Bridge" /><span>Harbour Bridge</span></a></li> <li><a href="http://eisabainyo.net/demo/images/image3.jpg" title="Sydney from the above" class="t3"><img src="http://eisabainyo.net/demo/images/thumb3.jpg" width="60" height="50" alt="Sydney from the above" /><span>Sydney from the above</span></a></li> <li><a href="http://eisabainyo.net/demo/images/image4.jpg" title="Sydney Buildings" class="t4"><img src="http://eisabainyo.net/demo/images/thumb4.jpg" width="60" height="50" alt="Sydney Buildings" /><span>Sydney Buildings</span></a></li> <li><a href="http://eisabainyo.net/demo/images/image5.jpg" title="The Iconic Opera House" class="t5"><img src="http://eisabainyo.net/demo/images/thumb5.jpg" width="60" height="50" alt="The Iconic Opera House" /><span>The Iconic Opera House</span></a></li> </ul> </div> </div> <div class="logo"></div> </div> header css Code: #header { float:left; width:790px; height:260px; background: url(../images/bg_header.gif) no-repeat; padding:0 5px 0 5px; position:relative; } #header .callus { float: left; width: 790px; height:60px; color:#FFF; display:inline; } #header .callus h3 { float:left; font-size:36px; } #header .callus p { float:right; text-align:right; font-size: 12px; line-height:20px; } #header #menu { float:left; width: 350px; margin: 0; } #header #menu ul {margin:0px; padding:0px; } #header #menu li { float: left; height:30px; list-style: none; } #header #menu li.backLava { background-color:#a9b3e3; position: absolute; } #header #menu li a { font-size:14px; font-family: "Trebuchet MS",Vedana,Geneva; text-decoration: none; padding: 8px; display: block; float: left; position: relative; z-index:10; } #header .logo { float:left; width:440px; height:200px; background:url(../images/Logo.gif) 20px 10px no-repeat; position:relative; } #header #gallery-wrapper { float:left; width:350px; height:120px; overflow:hidden; } #header #gallery-wrapper .gallery-pagination { float:left; } #header #gallery-wrapper .gallery-more { float:left; } Hi Please see watermark.sc It works fine in Firefox but header alignment is not proper in IE What might be the problem? San Hello all, still a little new to css layout problem-shooting in older browsers, so thanks for your help in advance! I'm having a problem which is only occurring in Internet Explorer 6, but I just can seem to figure out what's wrong. if you look at the page in any other browser, you can see the header <div> stretches the width: 100%, but in IE6, the header <div> does not extend all the way to the left, but rather starts where the margin:auto Main <div> tag starts from the left side. What I am lost on is that the footer <div> performs this just fine, but it's position is not fixed and there is no z-index. here is the code for both, and thanks again for having a look: #header { width: 100%; height: 107px; display: block; position: fixed; margin: 0px; padding: 0px; background-color: #000000; background-image: url(../images/main/bhs_design_header_gradient.jpg); z-index: 100; } #footer { width: 100%; height: 35px; display: block; background-color:#000000; margin-top: 10px; clear: both; text-align: center; font-family: Arial, Helvetica, sans-serif; font-size: 11px; font-weight: bold; color: #EBEAE8; margin: 0px; background-image: url(../images/main/bhs_design_footer_gradient.jpg); } Trying to delete my post but no option to delete so just removing content. hi i am trying to position some images in this box... #rightColumn { float: right; padding: 0px; margin:0 12px 0 15px; background: #F2FCFF; width: 350px; } there are 3 images and i wany them to go from left to right accross the box using this tutorial as inspiration. however, rather than use margins to space the images (this screws up what i am trying to achieve) i wanted to use css alignment i.e. leave the first image alone, centre the second and align right the third. I can't figure how to do it though... i've tried a couple of things but i still pretty wet behind the ears so don't have too much experience to draw upon.... i tried <div class="button"><img src="images/school-uniform-button.gif" alt="school uniforms" name="uniform" width="107" height="107" id="uniform"><div class="centre"><img src="images/school-equipment-button.gif" alt="classroom equipment" name="equip" width="107" height="107" id="equip"></div> <div class="jumpmenu"><img src="images/fees-button.jpg" alt="School fees" name="fees" width="107" height="107" id="fees"></div></div> and also with the <div class="button"> next to each image with the alignment divs. neither works and advice would be really appreciated thanks jim. Hi guys, I was hoping someone could help? I have the following css which controols the style for a larger image on hover function. (thumb - then large pic on hover) I am having trouble positioning (vertically) the image, what can I usew to control it? Code: /* Popup Image Viewer */ .thumbnail{ position: relative; z-index: 0; } .thumbnail:hover{ background-color: transparent; z-index: 50; } .thumbnail span{ /*CSS for enlarged image*/ position: absolute; background-color: #669933; padding: 1px; left: -1000px; border: 1px ridged; visibility: hidden; color: black; text-decoration: none; } .thumbnail span img{ /*CSS for enlarged image*/ border-width: 0; padding: 2px; } .thumbnail:hover span{ /*CSS for enlarged image on hover*/ visibility: visible; top: 0; left: 135px; /*position where enlarged image should offset horizontally */ } Nevermind, folks over at codingforums helped me. Hi There, If you put images in in replacement for standard form buttons they don't align properly. I have been trying to move away from nested tables with my current work in favour of css layouts and was wondering if there is any quick and easy way to align button images? If you look at the following URL the 'add to basket' buttons are higher up thean they should be..... http://www.storesprite.org/taml/vie...l?category_id=3 Thanks Hi. K, I have NO idea where to begin on this one. I need to display a series of thumbnails (to be selected dynamically from a database) inside 1 <td> tag. I need them to be organized 3 wide by 3 high, with their titles underneath. What would I use for this? I"m assuming I just set up a new class for that, but I don't know what to do for it. Any help is greatly appreciated. I'm really hung up on what class alignments I need to alter in order to get my thumbnails to align properly. If my thumbnails span the width of my page width, they are justified, but if they do not, they align left. The forum isn't letting me post a link to an example, but my website is at www dot the312hole dot com. The latest post shows an example of what I'm talking about with the thumbnails at the bottom of the post. Any advice on how to get them to always space evenly? Preferably with a predefined margin and padding that spaces them equally regardless of how many are in each row? Thanks for the help! This post can be deleted, I solved my problem. Hello all, I am trying to make a horizontal nav bar using a list. Everything was going good until I tried to add an image (essential a line) to seperate each <li>. When I did this, the height of the nav bar expanded and it moved the entire list down about 15 pixels or so. I am attaching an image before I added the image and after I added the image to show. Here is my css code for before I add the image: PHP Code: #navbar { height:37px; line-height:33px; padding: 2px 0 0 10px; vertical-align:top; background: url(images/linkbarbg1.png) repeat-x; font-family: Tahoma, Georgia, "Times New Roman", Times, serif; font-size: 18px; color: #FFFFFF; } #navbar ul { vertical-align:top; margin:0; padding:0; border: 0px solid #000000; } #navbar ul li { display: inline; } #navbar ul li a { display: inline; text-decoration: none; padding-top: 5px; padding-bottom: 4px; padding-right: 10px; padding-left: 10px; color:#FFFFFF; } #navbar ul li a:hover { height: 31px; background:url(images/linkbarbg1hover.png) repeat-x top left; background-color: #FF3300; } And HTML: PHP Code: <div id="main"> <div class="leftshadow"> <div class="rightshadow"> <div id="header"><img src="images/logo1.png" /></div> <div id="navbar"> <ul> <li><a href="#">Milk</a></li> <li><a href="#">Eggs</a></li> <li><a href="#">Cheese</a></li> <li><a href="#">Vegetables</a></li> <li><a href="#">Fruit</a></li> </ul> </div> </div> </div> And here is what it looks like: My CSS Code is the same for after, here is my HTML code for after: PHP Code: <div id="main"> <div class="leftshadow"> <div class="rightshadow"> <div id="header"><img src="images/logo1.png" /></div> <div id="navbar"> <ul> <li><a href="#">Milk</a></li> <li><img src="images/linkbarseperator1.png" /></li> <li><a href="#">Eggs</a></li> <li><a href="#">Cheese</a></li> <li><a href="#">Vegetables</a></li> <li><a href="#">Fruit</a></li> </ul> </div> </div> </div> and here is what is looks like: Is there a way to fix this? UPDATE I have noticed the same thing happens even when it is not a list. Therefore, it must be due to some other factor...does anyone have any ideas? Sounds simple... but I can't find an answer. I've a simple table row with a css background image. In the row I've my text links and two images that are links. While in firefox everything lines up nice and straight... in intercrash exploder it's all over the place, the images are almost subtext and the text is almost text top.. Any advice? The page can be seen at addcolour (co uk extension) CSS in a folder css the file name is addcolour Many thanks d hi i have following xhtml Code: <body> <div id="content" class="centrehack"> <div id="header" class="centrehack"> <div id="topRightLogin"> <form action="#" method="post"> <input type="text" name="uname" value="username" /> <input type="password" name="passwd" value="password" /> <input type="image" src="images/headerlogin.gif" /> </form> </div> and following css Code: .centrehack { margin: 0 auto 0 auto; } #content { width:960px; text-align:center; height:100%; overflow:visible; background:url(images/headerback.gif) repeat-x; } #header { width:960px; height:47px; text-align:center; } #topRightLogin { width:450px; height:47px; float:right; color:#fff; font-weight:bold; font-family:Verdana, Geneva, sans-serif; border:#000 solid 1px; height:30px; display:block; padding:0; } #topRightLogin input,submit { display:inline; padding:0px; margin-left:5px; height:21px; margin-top:0px; } i want to display form fields and submit button in a single line with perfectly aligned horizontally. but the form fields are showing empty area above them and going down than the submit button. the problem remains same in all browser. i am attaching a screenshot of the problem as well. any help is much apprecated. thanks What I hope to do is have a header with a left "cap" a right "cap" and a background tiling across connecting the two if that makes any sense whatsoever so if L is the left image B is the background image and R is the right image it would look like this... LBBBBBBBBBBR Anyway, I've ALMOST got it working. The only thing missing is the image on the right. I have this code in an html table cell: Code: <div id='logographicinner'> <div id='logostrip'> <div id='logographic'><div id='catname'>{$data['cat_name']}</div></div> </div> </div> and this in the css Code: #logostrip{ background-color: #ffffff; background-image: url(images/headerbg.gif); height: 29px; margin: 0px; padding: 0px; } #logostripinner{ background-color: transparent; background-image: url(images/headerright.gif); background-position: right; background-repeat: no-repeat; height: 29px; margin: 0px; padding: 0px; } #logographic{ background-color: transparent; background-image: url(images/headerleft.gif); background-position: left; background-repeat: no-repeat; height: 29px; margin: 0px; padding: 0px; } #catname{ text-align: left; padding-top: 7px; padding-left: 20px; font-weight: bold; } Any ideas what I've done wrong? I'm trying to have a logo in a div next to a navigation menu that can align at a specific height in my logo. but im having a problem with my li background images staying within the ul background image. Can someone help me fix my code to align this properly? HTML CODE: Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.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> <link href="style.css" rel="stylesheet" type="text/css" /> <!-- load the typeface.js library and typeface.js fonts --> <script src="js/typeface-0.14.js"></script> <script src="fonts/haettenschweiler_regular.typeface.js"></script> </head> <body class="oneColFixCtrHdr"> <div id="container"> <div id="header"> <div id="navigation" class="menu"> <ul id="top-nav"> <li class="item4"><a href="#" title="Contact">Contact</a></li> <li class="item3"><a href="#" title="About">About</a></li> <li class="item2"><a href="#" title="Ideas">Ideas</a></li> <li class="item1"><a href="#" title="Portfolio">Portfolio</a></li> </ul> </div> <div id="logo"><span><a href="http://www.nadesignstudio.com/" title="NA Design Studio" rel="home">NA Design Studio</a></span></div> <div class="clear"></div> <!-- end #header --></div> <div id="mainContent"><h1 class="typeface-js">Main Content </h1> <div class="typeface-js"> <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Praesent aliquam, justo convallis luctus rutrum, erat nulla fermentum diam, at nonummy quam ante ac quam. </p> </div> <!-- end #mainContent --></div> <div id="footer"> <p>na design inc, new york :: all right reserved 2010</p> <!-- end #footer --></div> <!-- end #container --></div> </body> </html> CSS CODE: Code: body { font: 100% Verdana, Arial, Helvetica, sans-serif; background: #FFFFFF; margin: 0; padding: 0; text-align: center; color: #FFFFFF; } .oneColFixCtrHdr #container { width: 800px; background-image: url(images/bg-stripe.png); background-repeat: repeat; margin: 0 auto; border: 1px solid #000000; text-align: left; } .oneColFixCtrHdr #header { padding: 10px 10px 0 10px; background: #000000; } .oneColFixCtrHdr #header h1 { margin: 0; padding: 10px 0; } .oneColFixCtrHdr #mainContent { padding: 0 10px; } .oneColFixCtrHdr #footer { padding: 0 10px; background: #000000; font-family: "Courier New", Courier, monospace; font-style: italic; font-size: 8pt; } .oneColFixCtrHdr #footer p { margin: 0; padding: 10px 0; } .typeface-js { font-family: Haettenschweiler; font-style: italic; letter-spacing: 1px; color: #FFFFFF; } #logo { display: inline; float: right; text-align: left; } #logo a{ background-attachment: initial; background-clip: initial; background-color: initial; background-image: url(images/logo.png); background-origin: initial; background-position: 0 0; background-repeat: no-repeat no-repeat; display: block; height: 118px; margin-bottom: 10px; text-indent: -9000px; width: 296px; } .msie #blog-title a { margin-bottom: -10px; position: relative; } #navigation { background-image: url(images/bg-nav.png); background-position: 0 0; background-repeat: no-repeat no-repeat; float: right; height: 22px; width: 474px; margin-top: 75px; } #navigation ul { } #navigation li { float: right; height: 22px; position: relative; list-style: none; } #navigation li a { font-family: Haettenschweiler; font-style: italic; letter-spacing: 1px; text-decoration: none; text-align: center; color: #FFFFFF; font-size: 0.95em; font-weight: bold; background-image: url(images/bg-nav-btn.png); background-repeat: no-repeat no-repeat; height: 22px; display: block; width: 69px; overflow: auto; } #navigation li a:hover { background-image: url(images/bg-nav-btn.png); background-position: 50% -22px; background-repeat: no-repeat; color: #000000; } #navigation li.item1 a { font-family: Haettenschweiler; font-style: italic; letter-spacing: 1px; text-decoration: none; text-align: center; color: #FFFFFF; font-size: 0.95em; font-weight: bold; background-image: url(images/bg-nav-btn1.png); background-repeat: no-repeat no-repeat; height: 22px; display: block; width: 69px; overflow: auto; } #navigation li.item1 a:hover { background-image: url(images/bg-nav-btn1.png); background-position: 50% -22px; background-repeat: no-repeat; color: #000000; } .clear { height: 0; font-size: 1px; margin: 0; padding: 0; line-height: 0; clear: both; } Example of problem If Image doesnt show below, view it he http://nadesign.pisigmachi.com/wp-content/uploads/2010/02/example.jpg URL Wondering if anyone can tell me why there is a gap above my header image. Surely I am missing something in Firebug? h**p://www.topofferspage.com |