CSS - Need Positioning Help For Nscape, Ff, Opera
Hi. I've redesigned my site using IE 6. The page can be referenced at http://flashdaddee.com/index_new.html.
In order to position the images on IE 6, I've done the following: #myclass { background:transparent url(my_img.gif) no-repeat; background-position-x:xpx; background-position-y:ypx; } Unfortunately, this does not work with Netscape, Opera, or Firefox. Can someone please give me some directions as to how to accurately position my images on these browsers? Your help is most graciously appreciated. Thanx. I intend to write separate pages for each browser and re-direct to the appropriate UA upon detection. If you could provide a script that does this, or direct me where to go to find such a script, I would also be most grateful. Similar TutorialsHello. This is probably not good practice but I have two problems arising with the same piece of code. Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>My site</title> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> <style type="text/css"> body { font-family: verdana, arial, helvetica, sans-serif; font-size: 0.8em; background: #cfcf00; margin: 0; /* it's good practice to zero the margin and padding of the body element to account for differing browser defaults */ padding: 0; padding-bottom: 2em; text-align: center; /* this centers the container in IE 5* browsers. The text is then set to the left aligned default in the #container selector */ color: #303030; } /* end body */ #logo_search { width: 100%; min-width: 957px; max-height: 79px; padding: 32px 0 0 0; border: 0; margin: auto; overflow: hide; background: #ffffff; } /* end #logo_search */ #logo_container { width: 40%; float: left; background: #ffffff; text-align: right; border: 0; border-bottom: 1px solid #ffffff; height: 51px; padding: 0; margin: auto; } /* end #logo_container */ #base { clear: both; padding-top: 1px; border-top: 1px solid #ffffff; border-bottom: 1px solid #ffffff; width: 100%; background: #c0c0c0; } /* end #base */ #main_block { background: #ff0000; margin: auto; text-align: left; width: 955px; } /* end #main_block */ #main_content { background: #ffffff; border-left: 1px solid #ff0000; padding-top: 1em; padding-bottom: 1em; border-right: 1px solid #ff0000; } /* end #main_content */ #top_main_content ul { float: left; list-style-type: none; border-spacing: 0; padding: 0; text-align: right; border-top: 1px solid #00ff00; height: 243px; width: 266px; } /* end #top_main_content #links_table */ #top_main_content ul li { vertical-align: middle; color: #0000ff; border-bottom: 1px solid #00ff00; } /* end #top_main_content #links_table td */ #top_main_content ul li a { line-height: 26px; padding-right: 1em; display: block; color: #0000ff; width: 259px; } /* end #top_main_content ul li a */ #top_main_content ul li a:hover { background: #cfcf00; color: #000000; } /* end #top_main_content ul li a:hover */ #top_main_content img { border-bottom: 1px solid #00ff00; border-top: 1px solid #00ff00; margin-top: 12px; text-align: right; vertical-align: top; } /* end #top_main_content img */ </style> </head> <body> <div id="logo_search"> <div id="logo_container"> </div> </div> <div id="base"> <div id="main_block"> <div id="main_content"> <div id="top_main_content"> <ul> <li><a href="#">Link 1</a></li> <li><a href="#">Link 2</a></li> <li><a href="#">Link 3</a></li> <li><a href="#">Link 4</a></li> <li><a href="#">Link 5</a></li> <li><a href="#">Link 6</a></li> <li><a href="#">Link 7</a></li> <li><a href="#">Link 8</a></li> <li><a href="#">Link 9</a></li> </ul> <img src="#" alt="" id="main_graphic" height="243" width="687"/> </div> </div> </div> </div> </body> </html> Problem 1 (Opera rendering): Opera (and only Opera from what I've noticed) is extended the border for the menu options into the side border. How can I eliminate this behavior? I added a margin-left: 1px to the menu and that will render it correctly in Opera but have an extra 1px of whitespace everywhere else. Problem 2: I'm trying to position this menu such that it lines up exactly with an image 243px high. One question I have is that if I add a 1px top and bottom border to an image that is 243px high, would that object still be 243px high or now 245px high? Also, I want to indent the menu options slightly so that they aren't exactly next to the image but I still need the entire bar to serve as a link. What would be the best approach to line up these objects. I can sort of do it with margin-top but I'm sure that's not the best way to go. Edited to add: Problem 3: The menu does not align with the left edge of the main section in IE and only IE. What can I do to fix this? I have problem with footer DIV in this layout (the order of DIV's in code after <body> should be - content, left, right, right2, header, footer - positioned centraly with fixed values): It needs to be sticked to fit after content of 4 column DIV's like it is in example. http://www.split.info/dev/less-content/ http://www.split.info/dev/more-content/ Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Title of website</title> <style type="text/css"> <!-- body {margin: 0px 0px 0px 0px; background-image:url(images/bg.jpg); background-position:center; background-repeat:repeat-y;} #wrapper {width: 1000px; margin: 0 auto; text-align: left; position: relative;} #contentPane {width: 468px; float: left; position: absolute; margin-left: 3px; padding: 0px 0px 0px 0px; background-color:#0099FF; left: 126px; top: 150px;} #leftPane {width: 125px; float: left; left: 0px; position: absolute; background-color: #99FFFF; top: 150px;} #rightPane {width: 173px; float: right; right: 226px; background-color:#999966; position: absolute; top: 150px;} #rightPane2 {width: 220px; float: right; right: 0px; background-color:#99FF00; top: 150px; position: absolute;} #headwide {background-image: url(images/head_bg.jpg); background-position: center; background-repeat: no-repeat; width: 100%; height: 142px; position: absolute; top: 0px;} #header {margin: 0pt auto; width: 1000px; background-color:#CC6600; height: 142px; } #footer {position: absolute; width: 100%; top: auto; bottom: 0px; background-color: #CCFFCC; height: 50px;} --> </style> </head> <body> <div id="wrapper"> <div id="contentPane">Content area<br> Content area<br> Content area<br> Content area<br> Content area<br> Content area<br> Content area<br> Content area<br> Content area<br> Content area<br> Content area<br> Content area<br> Content area<br> Content area<br> Content area<br> Content area<br> Content area<br> Content area<br> Content area<br> Content area<br> Content area<br> Content area<br> Content area<br> Content area<br> Content area<br> Content area<br> Content area<br> Content area<br> Content area<br> Content area<br> Content area<br> Content area<br> Content area<br> Content area<br> Content area<br> Content area<br> Content area<br> Content area<br> Content area<br> Content area<br> Content area<br> Content area<br> Content area<br> Content area<br> Content area<br> Content area<br> Content area<br> Content area<br> Content area<br> Content area<br> Content area<br> Content area<br> Content area<br> Content area<br> Content area<br> </div> <div id="leftPane">Left Pane area<br> Left Pane area<br> Left Pane area<br> Left Pane area<br> Left Pane area<br> Left Pane area<br> Left Pane area<br> Left Pane area<br> Left Pane area<br> </div> <div id="rightPane">Right Pane area<br> Right Pane area<br> Right Pane area<br> Right Pane area<br> Right Pane area<br> Right Pane area<br> Right Pane area<br> Right Pane area<br> Right Pane area<br> </div> <div id="rightPane2">Right Pane 2 area<br> Right Pane 2 area<br> Right Pane 2 area<br> Right Pane 2 area<br> Right Pane 2 area<br> Right Pane 2 area<br> Right Pane 2 area<br> Right Pane 2 area<br> </div> </div> <div id="headwide"> <div id="header">Header area</div> </div> <div id="footer"><strong>Content from above 4 column div's need to push footer DIV below (after them)! </strong>Footer area that is on bottom of div with biggest height (content, left, right or right 2 pane)... foooter follow right after end of content from those div's (regular behaviour of next table row below any of those 4 columns). Current state like it is in this document happens that if you add more data f.i. in content area (outside one screen), it will go trough footer... So footer can be either moved in code after rightpane2 div after end of wrapper. Pls help. Thx!</div> </body> </html> Content from above 4 column div's need to push footer DIV below (after them)! Foooter need to follow right after end of content from those div's (regular behaviour of next table row below any of those 4 columns). Current issue like it is in this layout happens that if you add more data f.i. in content area (outside one screen), it will go trough footer... So in your resolution footer can be also moved in code after rightpane2 DIV, after end of wrapper. Pls help. Thx! Echo hey, I have problems with getting CSS to display properly in Opera. http://www.hostultra.com/~lunaxy/home.php this host SHOULD be working. Anyway, the problem is with the side navigation menu. In Opera, theres gaps between the top and left bits (I used these to create the curved box effect). How do I get rid of this? 2nd problem. How do I move the top right navigation to the far right side. I can't float it without making it look bad in Opera (but IE and mozilla are fine). I want the stuff in the yellow box to be at the right side. thanx ppl! For some reason, this PHP Code: input.headtext {background-color: #515153;border: 0px outset #515153;} leaves a bright yellow hideous border around the input field. Is there any way to get rid of that? This works fine in IE and Netscape, but Opera 7.x makes it look like ****. Hi everyone Hoping someone can help with a niggly problem. My site is working great in Mozilla but I'm getting a gap between two divs in IE6 and Opera 7. Compare the following in IE6, Opera 7 and Mozilla and see the gap below both the 'welcome' and 'latest' graphics: http://www.crashingbydesign.com.au/newsite/ The relevant code is as follows: Code: <div id="content_container"> <div id="belowbg"> <div id="left"> <div id="h3lft"> <h3>Welcome</h3> </div> <div id="contentlft"> <p>Lorem ipsum ...</p> </div> <div id="footlft"></div> </div> <div id="right"> <div id="h3rght"> <h3>Latest</h3> </div> <div id="contentrght"> <p>Lorem ipsum ...</p> </div> <div id="footrght"></div> </div> </div> <div id="footer"> <p>text</p> </div> </div> The relevant CSS is as follows: Code: #content_container { position: absolute; top: 406px; left: 50%; margin: 0 0 0 -372px; width: 742px; height: auto; z-index: 10; } #belowbg { padding: 0 11px 11px 11px; width: 720px; height: auto; background-color: #313131; } /*hack to ensure that Mozilla encloses the floats with the #belowbg div*/ #belowbg:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } #left { float: left; width: 481px; height: auto; padding: 0; margin: -25px 0 0 0; } #h3lft { width: 481px; height: 25px; background: url(images/welcomehd.gif) no-repeat; text-indent: -9000px; display: block; position: relative; margin: 0; padding: 0; } #contentlft { width: 459px; height: auto; background-color: #293942; border: 1px solid #636B73; margin: -1px 0 0 0; padding: 10px 10px 0 10px; font-size: 1.2em; line-height: 1.6; display: block; } #footlft { width: 481px; height: 20px; margin: -1px 0 0 0; background: url(images/welcomeft.gif) no-repeat; display: block; } #right { float: right; width: 230px; height: auto; padding: 0; margin: -25px 0 0 0; } #h3rght { width: 230px; height: 25px; background: url(images/latesthd.gif) no-repeat; text-indent: -9000px; display: block; position: relative; margin: 0; padding: 0; } #contentrght { width: 208px; height: auto; background-color: #525252; border: 1px solid #636B73; margin: -1px 0 0 0; padding: 10px 10px 0 10px; font-size: 1.2em; line-height: 1.6; display: block; } #footrght { width: 230px; height: 20px; margin: -1px 0 0 0; background: url(images/latestft.gif) no-repeat; display: block; } #footer { position: relative; top: 0; left: 0; width: 720px; height: 188px; padding: 20px 10px; margin: 0; background: url(images/btmhatlines.gif) right no-repeat; font-size: 1.1em; line-height: 1.6; text-align: center; } Can anyone see my mistake? Cheers Hi, have a weblog, powered by wordpress, styled with css. it looks all right in firefox & IE, but i'm not too happy with the look in opera, as the content has a large blank gap between the first post and the rest of the content. to view my site: http://www.jarra.nl/ CSS: http://www.jarra.nl/css/weblog.css and this is a screenshot: http://www.jarra.nl/_TEST/opera.gif I can't find out what's causing it, and don't have an idea how to solve it, any help is appreciated a lot.. thanx, jarra Hi all, I got my css layout to work in Opera, which is already an achievement for a newbie like me. But I'm facing some problems with FF and IE. First: in both the header image is gone Second: in IE the menu images are shown too wide resulting in a messed up menu Third: IE for some reason widens up the sidebar and content so the sidebar is shown below and also the footer is misplaced. I'm still trying to debug it myself but I don't seem to be able to solve them. my blog Any help or ideas are appreciated. Kind regards, Jef My little attempt to create a totally horizontal layout crashed against that crap Opera. Here's the page, and some piece of code: Code: body { height: 400px; width: 2000px; border-bottom: solid 1px #000; background: #fff url(img/bg_body.jpg) no-repeat top right; margin: 0px; } As you can see, in Opera the background image is not displayed at the top right of the body.. any ideas? I've tried the html width 100% trick but no luck. hey all, I'm trying to display a <b> as a block and have its height be 100%, unfortunately in opera and safari it doesn't display anything. If i set the height to be 100px it displays it, but it doesn't like percentages. Anyone know why? and how to fix it? thanks, - legit I use Opera browser all the time and notice a couple problems while using Jupitor Portal script, the fault is on Opera so I need a way to fix this. 1. Block had some sort of padding or whitespace on the right side for some reason. 2. Search button width is short. Problem in red: URL Site: URL CSS: URL Can someone give me a solution or work around for this problem. P.S: I'ved tried adding margin: 0; padding: 0; to con1 but that didn't work. Please have a look here with Opera. As you can see, the background image is pushed to the top and all you can see it's a little part of the image. Here's part of the css code: Code: body { background: #FFF url(img/bg_body.jpg) no-repeat bottom right; } How could I solve it? I can't set a fixed height because in lower res the layout goes bye bye. Hey everyone, I am working on an old design I started a while back, and for some reason, IE and Opera do not render the top padding right. I figured that it is a bug, but I am not sure. Here is my code: css Code: Original - css Code body { background-image: url( http://img521.imageshack.us/img521/6097/blissxk5.png ); color: #000000; font-family: verdana,tahoma,"Bitstream Vera Sans",arial,helvetica,sans-serif; font-size: 12px; text-align: center; padding: 0; margin: 0; } a img { border: 0; } a,a:link,a:visited,a:hover,a:active { color: #0099FF; text-decoration: underline; } a:hover { color: #FF9900; text-decoration: underline; } #container { width: 85%; margin: 0 auto; text-align: left; } #header { padding-left: 150px; } #menu { width: 100%; text-align: center; } #menu ul { list-style-type: none; display: block; } #menu li { display: inline; } #menu a { padding-left: 45px; padding-right: 45px; padding-top: 15px; padding-bottom: 15px; } #menu a:hover { opacity: .8 !important; background-color: #999999; color: #FFFFFF; } #main { opacity: .6 !important; filter: alpha(opacity=50); background-color: #FFFFFF; padding: 1%; text-align: justify; } #main h1 { color: #0075FF; border-bottom: 2px solid #0099FF; display: block; width: 60%; } #footer { text-align: center; } #footer a { color: #000000; } body { And also IE6+ do not seem to render the filter property. Anyone know whats going on with this? looks perfect in Moz and IE...but any time I set a padding it overhangs the actual width. So the below code creates a 1010px wide result...is there a workaround for Opera sucking? Code: .topa { width: 1000px; padding: 5px; background:#000000 } edit: nesting a div and putting the padding on it without a background seems to work...while I'm sure it is overhanging the same way, at least it doesnt LOOK that way. Hi, Well, they're at it again, those cheeky browsers. Check it out. I have a site that consists of a main, central container, with a background image of 675x1px. So far I also have a top banner and a menu bar both 600px wide. The extra 75px are drop shadows either side of the main box of colour. In IE, I put my banner and menu divs into the container and everything works fine - they're nicely centred and look good. However, in opera/firefox, the divs are over to the left of the central container, and hence screw everything up. Also, even though my central container has 100% height, in Opera it doesn't extend to the bottom of the page. Here's the CSS: Code: /* CSS Document */ body { background-color:#E1FFDC; text-align:center; margin:0px; } #container { width:675px; height:100%; background-image:url(mainbg2.gif); background-repeat:repeat-y; margin-left:auto; margin-right:auto; text-align:center; } #mainphoto { width:600px; height:278px; margin-left:2px; background-image:url(maintop.jpg); position:relative; } #menubar { width:600px; height:39px; margin-left:1px; position:relative; } mainbg2.gif is the central container background And the page is here Any help would be much appreciated. Cheers NEWSFLASH Problem solved - i basically just took the images out of their divs. I still have a problem with Opera not stretching the div down though, but I think that will be solved once I put some content in. Hi guys, I am currently building a website for my union service, and need some help with CSS; particularly in getting it to render consistantly over different browsers. Although I use Firefox at home, the only browser available at work is IE5 (currently running under Windows NT). The Previews: Internet Explorer 5: Internet Explorer 6: Firefox: Opera: What I am trying to achieve is for the #navigation div to align with the sIFR header (this is rendered correctly in IE5/IE6). Firefox and Opera seem to offset the header, meaning that the header and #navigation div no longer align. The 'perfect' rendition seems to be IE6 - if anyone knows what I may need to adjust in me CSS to get this to work consistantly I would really appreciate it. You can see the beta version of the design at: http://www.algus.org.uk/xhtml.php Thanks, Saj Hi, Av just check my website in Opera for the mac and found something annoying.. I have problems with my header and footer.. Screenshots: http://i45.photobucket.com/albums/f56/phi21/Picture1-6.png Header cut off http://i45.photobucket.com/albums/f56/phi21/Picture2-3.png massive footer Works fine in everything else.. what could be happening ? Thanks www.leehughes.co.uk I have created a navbar to be absolutely positioned in the header; works fine in FFox and IE/Win. Works in Safari as well. But Opera 7/Win and IE 5/Mac don't treated the positioning correctly. I've got the XHTML to validate. Don't know what's up. Take a look: http://dev3.witechcolleges.org/ Thanks. Hey everyone, My page renders correctly in Safara, Firefox and Internet Explorer. However Opera 9.27 causes a bit of concern. The stylesheet is as follows Code: html, body, h1, h2, h3, h4, ul, li { margin: 0; padding: 0; } h1 img { display: block; } img { border: 0px none; } a { color: #464544; } a:hover { color: #FFA405; } .left { float: left; } .right { float: right; } .clear { clear: both; } body { background: #ECF4F7; text-align: center; font: 11px verdana, arial, sans-serif; color: #695F4C; padding-bottom: 10px; } /** layout **/ #wrapper { text-align: left; margin: 37px auto; width: 839px; background: #ffffff; position: relative; padding: 0; } #header { background: #D9D1BC url('images/logo.jpg') no-repeat; height: 192px } #nav { background: #4B5360; position: absolute; top: 153px; left: 339px; width: 499px; height: 20px; padding: 9px 0px; text-align: center; margin: 0; } #nav li { list-style: none; display: inline; color: #fff; } #nav a { text-decoration: none; color: #fff; } #body { background-color:#FFF; } #postheadb { font: 10px verdana, arial, sans-serif; font-weight: bold; color: #FFFAF0; float: right; width: 500px; background: #2dbaa7; } #postheadb .inner { padding: 6px 12px; width/**/:/**/ 501px; Height/**/:/**/ 10px; } #postheadab p { margin: 0.9em 0; } #posthead { font: 10px verdana, arial, sans-serif; font-weight: bold; color: #FFFAF0; float: right; width: 839px; background: #2dbaa7; } #posthead .inner { padding: 6px 12px; } #posthead p { margin: 0.9em 0; } #contentb{ font: 12px verdana, arial, sans-serif; color: #cad10e; float: right; background: #40789d; } #contentb .inner { padding: 6px 12px; width/**/:/**/ 476px; Height/**/:/**/ 52px; } #contentb p { margin: 0.9em 0; } #content{ font: 12px verdana, arial, sans-serif; color: #cad10e; float: right; width: 839px; background: #40789d; } #content .inner { padding: 12px 12px; } #content p { margin: 0.9em 0; } #copyright { text-align: center; background: #030303; font-size: 9px; padding: 2px; width/**/:/**/ 92.8em; Height/**/:/**/ 3em; } input { color: #FFFAF0; background: #40789d; vertical-align: middle; } .email input { position:absolute; left: 40px; top: 20px; color: #781351; width: 225px; background: #fee3ad; } #sidebar { margin-bottom:0; float: left; background: #D3D3D3; padding: 395px 169px; Height/**/:/**/ 70px; } .videobar { position:absolute; left: 20px; top: 200px; height: 600px; width: 300px; float: right; padding: 10px; } .password input { position:absolute; left: 40px; top: 60px; color: #781351; width: 225px; background: #fee3ad; } #login{ font: 10px verdana, arial, sans-serif; font-weight: bold; color: #FFFAF0; float: right; width: 839px; background: #2dbaa7; } #searchTerm{ width: 125px; height: 15px; } #submitsearch{ height: 22px; } #login .inner { padding: 90px 12px; } #login p { margin: 0.9em 0; } .submit input{ position:absolute; left: 40px; top: 90px; width: 55px; height: 22px; padding: 0; } fieldset { border: 1px solid #781351; position: absolute; left: 300px; height: 130px; top: 215px; width: 300px; } legend { background-color: #ffa20c; border: 1px solid #781351; line-height: 1.5em; position: relative; top: -0.75em; } The website displayed in Firefox can be seen here Firefox and Opera here Opera many thanks, Doug Hello there! I am new here.. So Hello to all of you people. I am having a problem. I run my website locally and i can preview it fine in chrome, firefox and ie.. but i have a problem with opera. I see a white space under my footer.. Let me give you my code and please tell me your opinions! Code: * { padding:0; margin:0 0 0 0px; outline:0; } html, body { height:100%; } Code: /* center all content */ .center { width:950px; margin:0 auto; } /* keep all content except footer */ #wrapper, #wrapper-error { min-height: 100%; height: auto !important; height: 100%; margin: 0 auto -82px; } #wrapper-error { margin-bottom: 0px; } .footer { width:100%; height: 82px; position:relative; background-image: url('../images/bgfooter.jpg'); background-repeat: repeat-x; -moz-box-shadow: 0px -13px 130px 20px #808080; -webkit-box-shadow: 0px -13px 130px 20px #808080; box-shadow: 0px -13px 130px 20px #808080; } .push { width:100%; height: 82px; position:relative; } Thank you! See how links went up. how to put them in middle |