CSS - Elements Not Shown, Or Not As Stated
I have differences between how elements I state in CSS are shown. Sometimes it's IE that makes the problems (mostly with overflow) but this time it's FF.
I have a content, to which I decided to make a "wrap" border from right and left (shown in red on the screenshots). The name of the element is #content_wrap. Could you take a glance at the links below and help me out finding the problem that causes this difference between the display in IE and FF? The way I see the page using IE (the way it's supposed to be - shown via green) The way I see the page using FF (the wrap is not at it's full height - show via green) The complete page (the CSS is included in the html file) P.S. If you have any other comments and suggestions, they are welcome. Similar TutorialsI am using the code below to draw the bottom on the forum. Why is it drawing a 775 pixel line in Safari and Firefox? Live example, it's the 10px wide black line for clarity, the forum is 776 pixels wide, this line draws as 775 pixels. http://centerstageproject.com/forum_test/viewthread.php?tid=1057 Quote: <!-- START TEST CODE --> <div style="text-algin: center"> <div style="width: 776px; margin: 0 auto 0 auto; border-top: 10px solid black;" > </div> </div> <!-- END TEST CODE --> Ingor this I found a work around, I do not use this code any more. I was quite proud of that title, especially at 4 minutes past monday. Anyway - I digress. I am trying to create a scrolling news-type box using a div which is clipped so it looks like it scrolls up and down inside a 'window'. I have not declared what height i want the scrolling div to be as i never know how much text will be in it. When you scroll all the way to the bottom, I want there to be a way so that it stops scrolling - and for this i need the height of the div. Is there anyway of finding the height at all, or will i have to use a fixed height div. If my explanation is a touch wooly, the prototype page is here Hello all, I'm having a bit of trouble with a list of relative, floated <li> elements, each containing a single absolutely positioned div that appears on hover. I'm using the :hover pseudo-class currently but I will use JavaScript for IE6 once it displays correctly. The code is below. The problem is that the <div> appears on top of it's parent element but behind all other elements. Code: #wrapper-body ul.staff-list{ list-style-type:none; padding-top:10px; position:relative; } #wrapper-body ul.staff-list-team{ width:313px; padding-top:0; padding-bottom:15px; margin-bottom:20px; border-bottom:1px solid #d7e3a9; } #wrapper-body ul.staff-list li{ float:left; width:230px; position:relative; padding:8px 0 8px 15px; z-index:1; } #wrapper-body ul.staff-list-team li{ width:151px; padding-left:0; padding-left:5px; } #wrapper-body ul.staff-list-team li.right{ padding-left:5px; } #wrapper-body ul.staff-list-clerks li{ float:none; width:310px; padding-left:5px; } #wrapper-body ul li.highlight{ background-color:#f4f6ec; } #wrapper-body ul.staff-list li p{ padding:0 0 9px 0; margin-left:91px; } #wrapper-body ul.staff-list li small{ padding:0 0 5px 0; margin-left:91px; } #wrapper-body ul.staff-list-clerks li span{ color:#A6302B; display:block; float:left; } #wrapper-body ul.staff-list-clerks li span.clerk-name{ width:140px; } #wrapper-body ul.staff-list-clerks li span.clerk-phone{ width:120px; background:url(../img/structure/clerks-phone.gif) 0 2px no-repeat; padding-left:23px; } #wrapper-body ul.staff-list-clerks li a.clerk-email{ display:block; float:left; height:16px; width:16px; background:url(../img/structure/clerks-mail.gif) 0 3px no-repeat; } #wrapper-body ul.staff-list li div.staff-list-detail{ display:none; background:url(../img/structure/staff-list-bottom.gif) left bottom repeat-x; padding-bottom:3px; margin-top:-15px; left:4px; z-index:10; top:15px; position:absolute; } #wrapper-body ul.staff-list li div.staff-list-detail a{ background:url(../img/structure/staff-list-bullet.gif) no-repeat 0 4px; padding-left:8px; } #wrapper-body ul.staff-list li:hover div.staff-list-detail{ display:block; } An image of what is happening below: Thanks for reading! I've changed how links are rendered - problem is that I can't stop same thing being done on images as links. Code: a { text-decoration: none; border-bottom: 1px dotted; } a:hover { text-decoration: none; border-bottom: 1px solid; } And it works great on ordinary links (<a href="#">Text here</a>) but I cant turn it off when I have an image as a link (<a href="#"><img ... /></a>). I tried this : Code: a img { border: none; /* tried border: 0px; also */ } img { border: none; /* tried border: 0px; also */ } And it doesn't work The only way I could achive the result is to specify an class for each link: Code: .img-link { border: none; } .img-link:hover { border: none; } // in HTML <a href="#" ... class="img-link"><img ... /></a> The code for the problem are below. I have two examples in my html file. One using styles directly and one using styles via a file. The styles are identical. The first div tags that uses styles directly shows correctly, but the other div tags doesn't even show at all - or at least not with 'height' in '.page' set to 'auto'. If it's set for example to 200px that div will show but not the sub ones. This is strange since if using the same styles directly this isn't even a problem at 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"> <head> <title>Testing...</title> <link rel="stylesheet" type="text/css" href="test.css" /> </head> <body style="margin: 0px; padding: 0px; text-align: center; background-color: #A0A0A0"> <div style="position: relative; width: 950px; height: auto; margin: 10px auto; padding: 0px; background-color: #FFFFFF"> <div style="position: absolute; top: 0px; left: 0px; width: 950px; height: 150px; margin: 0px; padding: 0px;"> <div style="position: absolute; top: 0px; left: 0px; width: 20px; height: 150px; margin: 0px; padding: 0px; background-color: #C08080;"></div> <div style="position: absolute; top: 20px; left: 30px; width: 890px; height: 130px; margin: 0px; padding: 0px; background-color: #80C080;"></div> <div style="position: absolute; top: 0px; left: 930px; width: 20px; height: 150px; margin: 0px; padding: 0px; background-color: #8080C0;"></div> </div> </div> <div class="page" style="top: 200px;"> <div class="header"> <div class="header-left"></div> <div class="header-image"></div> <div class="header-right"></div> </div> </div> </body> </html> Hello, I am using image borders and the CSS I have works on FireFox, Chrome, Opera and Safari, but not IE. Here is my CSS and HTML; Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="" > <head> <style> div { width: 200px; margin: 0px auto; border-width: 0px 2px 0px 2px; -moz-border-image: url(b.PNG) 0 41 repeat; -webkit-border-image: url(b.PNG) 0 41 repeat; -o-border-image: url(b.PNG) 0 41 repeat; border-image: url(b.PNG) 0 41 repeat; } </style> <head> <body> <div>Hello this is my test <br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /> </div> </body> </html> I have tried it on IE6 to 8 and image borders show on none of these. Is there any hack/way how to support image borders also on IE? Hello, I have a weird problem with IE7. My solution works fine on FireFox, IE8 and even IE6, but on IE7 the button image does not want to load. Here is the HTML and CSS. Code: <!DOCTYPE html> <html> <head> <style> .sayhello{ background: url("hello.png") no-repeat scroll 0 0 transparent; border: medium none; height: 49px; margin-top: 10px; text-indent: -9999px; text-transform: capitalize; width: 85px; } </style> </head> <body> <input type="button" onclick="javascript:alert('hello');" value="Say Hello!!" class="sayhello"> </body> </html> I can get the button to show if I set the button as position:absolute or else display:block. However these would create me other problems. Is there any other way how I can get the button to show? considering I want to show the button in relative position and next to other buttons. Hi, I have a table with a scroll bar. My problem is that it works in ie but not in mozilla,netscape7.1, firefox...When I load the page in mozilla, the table is not shown, it's as if it were set to hidden, and it's really weird because the first time that I load the page, the table is shown with the scroll bar just for a moment and then hides..... I used a div tag that contains the table to be shown. I've tried different things as changing the z-index, using the display attribute, but none of them worked. Here is the style defined for the div tag: Code: div.tableContainer_plegado{height: 420px; overflow: auto; width:100%;} Please help me! Thanks in advance! I am using an external CSS where I am defining the color of my links when un-visited, visited etc. The problem is in Netscape 7.1/7.2 those links which are calling my other pages, are being shown up as visited when clicked,. But those where I say href='javascript:void(0);my js function' are not being shown with the correct 'visited' link color. They are being shown in the color specified for 'un-visited' links!! Can someone help?? Hi all, I use an background image for a menu. Code: #menu a, #menu a:hover { height: 20px; width: 150px; text-decoration: none; padding-left: 40px; padding-top: 3px; padding-right: 3px; font-weight: bold; font-family: Arial, Helvetica, sans-serif; font-size: 11px; margin-bottom: 10px; background-position: 0px; vertical-align: middle; } #menu a { color: #9E007F; background-image: url(../imgs/nav/subNav/subNav_bg.gif); background-repeat: no-repeat; } #menu a:hover { color: #FFF; background-image: url(../imgs/nav/subNav/subNav_bg_over.gif); background-repeat: no-repeat; } It works fine in IE but not in firefox. Somehow the background image is not completely shown. It stops after the last letter. Any suggestions?? Grtz, I'm making a webpage for myself, and am coding to current Transitional XHTML and CSS standards. I'm using Firefox 0.9.2 for viewing the page. The problem I'm having is with adding a class to a <td> element and getting it to work correctly in IE 6. The CSS class I'm using for the <td> element is as follows: Code: .w3type{color: black; background-color: #FFCE6B;} Code: .w3type:hover{color: white; background-color: red; background-image: url(images/mrgreen.gif); background-repeat: no-repeat; background-position: right;} I add this class to a <td> tag: Code: <td class="w3type"> and when i view it in FF, the text and background work correctly, changing color and adding a little image to the right when I hover my mouse over it. The problem is that when I go to view the code in action with IE 6, neither the background nor the image will appear on hover. Is this a problem with IE, or my code? If you want to see the code on my site, here's the link. The css formatting in question is on the lower left corner of the page (the W3C webbadges). Thanks for any help I'm floating an image left and on the right, I'm placing a tabbed menu. FF lines the menu at the top-right corner, IE lines it up at the bottom-right(which is correct). I've tried margin, padding, vertical-align, but nothing will pull that menu down without severely affecting IE. Any suggestions? Hi All, Still working on a site for a friend. www dot helenstow-cpsychol.co.uk/faqs dot html On this page, I want the scrolling '#content1' box to be about 200-250 pixels longer, but in making it longer it overlaps vertically with other elements on the page ('#nav1' etc) and displaces them. The way elements are placed relative to each other was designed by someone very kind on another forum. I find it quite confusing to be honest (Im a total newb.) and was wondering if this is the best way to do this or if there is a way of aligning elements by just specifying where on the page they should be without necessarily affecting the position of other elements? (Is this possible using z-index?) If this is possible, how might I go about it and is it a good or bad idea? (the guy who helped me previously appeared to be pretty smart, so I'm guessing there's a reason he laid things out the way he did) Here is my CSS: Code: * { padding:0; margin:0; list-style-type:none; } .link1 a:link,.link1 a:visited,.link1 a:active { color:#000000; font-family:arial,helvetica,sans-serif; font-weight:bold; } .link1 a:hover { background-color:#000000; text-decoration:none; } .link2 a:link,.link2 a:visited,.link2 a:active { color:#00def5; font-family:arial,helvetica,sans-serif; font-size:16px; font-weight:bold; } .link2 a:hover { color:#fff; background-color:#286d8c; text-decoration: none; } .link3 a:link, { color:#FFFFFF; font-family:arial,helvetica,sans-serif; font-size:24px; font-weight:bold; } .link3 a:visited,.link3 a:active { color:#42daf5; font-family:arial,helvetica,sans-serif; font-size:24px; font-weight:bold; } .link3 a:hover { color:#FFFFFF; text-decoration: none; } body { background-color:#000; font-family:tahoma,arial,helvetica,sans-serif; font-size:100%; text-align: center; } h1 { font:bold 20px tahoma,helvetica,arial,sans-serif; color:#ffa507; text-shadow:0 1px 1px #000; text-align:center; text-decoration:underline; } h2 { font:bold 18px tahoma,helvetica,arial,sans-serif; color:#ffff01; text-shadow:0 1px 1px #000; text-align:center; text-decoration:underline; } h3 { font:italic 16px tahoma,helvetica,arial,sans-serif; color:#fff; text-shadow: 0 1px 1px #000; text-align: center; } h4 { font:bold 16px tahoma,helvetica,arial,sans-serif; color:#000; text-shadow: 0 1px 1px #ffa507; text-align:center; text-decoration:underline; } h5 { font:bold 16px tahoma,helvetica,arial,sans-serif; color:#000; text-align:center; } #container1 { width:1008px; height:1168px; margin:auto; background-image:url(../images/Alt-Pages-BG.jpg); } #content1 { width:515px; height:448px; padding-top:20px; padding-bottom:0px; padding-right:5px; padding-left:5px; border:3px solid transparent; margin-top:0px; margin-bottom:0px; margin-right:0px; margin-left:55px; text-align:center; overflow:auto; } #content2 { width:900px; height:20px; border:3px solid transparent; padding:0px 0px 0px 0px; margin:185px 54px 0px 54px; font-family:tahoma,arial,helvetica,sans-serif; font-size:14px; color:#fff; text-align:center; overflow:auto; } #content3 { width:260px; height:100px; padding-top:0px; padding-bottom:0px; padding-right:15px; padding-left:15px; margin-top:20px; margin-bottom:0px; margin-right:110px; margin-left:110px; border:3px solid #000; background-color:#fff; font-family:tahoma,arial,helvetica,sans-serif; font-size:14px; color:#000; text-align:center; overflow:auto; } #content4 { width:400px; height:180px; padding-top:0px; padding-bottom:0px; padding-right:15px; padding-left:15px; margin-top:20px; margin-bottom:0px; margin-right:0px; margin-left:42px; border:3px solid #000; background-color:#fff; font-family:tahoma,arial,helvetica,sans-serif; font-size:14px; color:#000; text-align:center; overflow:auto; } #nav1 { margin-bottom:36px; overflow:hidden; } #nav1 li { margin-bottom:40px; position:relative; } #li1a {margin-left:835px;} #li1 {margin-left:761px;} #li2 {margin-left:687px;} #li3 {margin-left:613px;} #li4 {margin-left:539px;} #li5 {margin-left:465px;} #li6 {margin-left:391px;} #li7 {margin-left:28px;} #li8 {margin-left:96px;} #li9 {margin-left:90px;} #li10 {margin-left:92px;} #li11 {margin-left:332px;} } #nav1 a,#nav2 a { position:relative; display:block; height:30px; background-image:url(../images/Icons.jpg); } #nav1 span,#nav2 span { position:absolute; top:0; left:0; height:30px; z-index:1; background-image:url(../images/Icons.jpg); cursor:pointer; } #home,#home span { width:149px; background-position:-835px -584px; } #about,#about span { width:223px; background-position:-761px -644px; } #appts,#appts span { width:297px; background-position:-687px -704px; } #fees,#fees span { width:371px; background-position:-613px -764px; } #faq,#faq span { width:445px; background-position:-539px -824px; } #links,#links span { width:519px; background-position:-465px -884px; } #blog,#blog span { width:593px; background-position:-391px -944px; } #home:hover span { width:149px; background-position:-835px -3px; background-image:url(../images/Icons.jpg); } #about:hover span { width:223px; background-position:-761px -63px; background-image:url(../images/Icons.jpg); } #appts:hover span { width:297px; background-position:-687px -123px; background-image:url(../images/Icons.jpg); } #fees:hover span { width:371px; background-position:-613px -183px; background-image:url(../images/Icons.jpg); } #faq:hover span { width:445px; background-position:-539px -243px; background-image:url(../images/Icons.jpg); } #links:hover span { width:519px; background-position:-465px -303px; background-image:url(../images/Icons.jpg); } #blog:hover span { width:593px; background-position:-391px -363px; background-image:url(../images/Icons.jpg); } #nav2 li { float:left; display:inline; position:relative; } #nav2 a { height:124px; } #nav2 span { height:124px; } #bps,#bps span { width:131px; background-position:-28px -1041px; } #hps,#hps span { width:131px; background-position:-180px -1041px; } #scp,#scp span { width:131px; background-position:-332px -1041px; } #pay,#pay span { width:131px; background-position:-484px -1041px; } #email,#email span { width:131px; background-position:-849px -1041px; } #bps:hover span { width:131px; background-position:-28px -460px; background-image:url(../images/Icons.jpg); } #hps:hover span { width:131px; background-position:-180px -460px; background-image:url(../images/Icons.jpg); } #scp:hover span { width:131px; background-position:-332px -460px; background-image:url(../images/Icons.jpg); } #pay:hover span { width:131px; background-position:-484px -460px; background-image:url(../images/Icons.jpg); } #email:hover span { width:131px; background-position:-849px -460px; background-image:url(../images/Icons.jpg); } I'd also like to be able to move '#content1' down about 10 pixels from the top of the page (but when I add 10 pixels to the 'margin-top' it moves the background image for '#container1' down with it!? I would be incredibly grateful for any and all help. My very best wishes, Tom Hi, q)I have a horizontal menu of 4 text buttons on top on screen and another bit of text on the left of it . I have a text element on far left and 4 text elements on far right . The whole section is in a div tag which displays it in a horizontal bar of 10% height. To place the text elements of far right I use float but this displays it on line below where i want it. I want text on far left and menu on far right (no spaces between each link) all in the same line. Code: #t1 a {font-size:10px; font-family:verdana; font-weight:bold; border:1px outset aqua; background-color:aqua; color:#000000; text-decoration:none; display:inline; width:15% word-spacing: 0; } ... <div id="t1"> This is the place where the logo goes <a href="#">Java Script</font></a> <a href="#">Dynamic HTML</font></a> <a href="#">Java Script</font></a> <a href="#">Dynamic HTML</font></a> </div> Firstly, I'd like to say that I've been browsing this forum for a while now, as well as sites such as w3schools, and I've found it all to be very helpful. But now I have a situation that I haven't been able to solve on my own. Essentially, I want to make a clear and simple CSS-based layout that will work across browsers and platforms. I use a Mac myself, and it's difficult for me to check for problems with Internet Explorer. The problem I'm currently having concerns layout and positioning. Here's a link to the splash page I'm working on for a student organization: http://individual.utoronto.ca/ghp/fasu2006/ Before I make the full site I want to work out layout troubles I've been having. I got on a PC and the text when viewed with IE did not seem to properly align within the opaque white box I made for it. I've been feeling a little overwhelmed with concepts of absolute vs. relative positioning, unit values such as percents, px, em, and making use of things like padding, margins etc. and I'm hoping I can get some advice. So in one sentence, here is my question: How can I position elements (text, divs, images, anything) on the screen using CSS in an efficient way that will produce a similar result in different browsers? Here is the code that I think is relevant: Code: p {font-size: .75em; font-weight: bold; margin-left: 12em; margin-top: 8em;} #content {margin-top: 10px; margin-bottom: 10px; margin-right: auto; margin-left: 3em; width: 800px; padding: 20px; background: transparent;} #overlayback {position: absolute; top: 8em; left: 15em; width: 250px; height: 250px; z-index: 0; filter: alpha(opacity=80); opacity: .80; background: #FFF;} #overlaytext {position: absolute; top: 3em; left: 15em; z-index: 1;} h1 {font-size: 6em; margin-left: .1em; margin-top: .75em;} h2 {font-size: 1em; font-weight: normal; margin-left: 9em; margin-top: -4.5em} </style> </head> <body> <div id="content"><img src="images/tower.gif" width="297" height="422" alt="tower"> <div id="overlayback"></div> <div id="overlaytext"><h1>fasu</h1> <h2>2006-2007</h2> <p>coming soon</p></div> </div> I hope I've been clear and thanks in advance for any advice. It's very much appreciated. Hi everyone -- first post here in the forums. I hope I can get some pointers on how to get my page to display correctly in IE. I have 2 div tags at the top of my page that are built sorta like this: Code: <div> <ul> <li> some thing (images in my case, and a search bar) </li> </ul> </div> My css for these elements has "list-style:none;" -- and this works great in modern browsers like firefox, chrome, safari, opera... but the old dinosaur which 30% of my visitors still use doesn't handle this all right. See, I am displaying these list elements in a single horizontal row, but IE wants them in a single vertical column. UGH. I have a post with a screen shot from firefox and IE at this link: http://corneveaux.com/blog/new-animated-banner-and-internet-explorer-sucks So, I am sure its something I have done wrong -- but I cannot get my arms around the problem with firebug or IE developer tool bar. I am a total CSS newb here, so any tips much appreciated. Oh, and I checked and indeed my CSS validates. Thanks everyone! I'm trying to align an image, header, and some text that is right aligned all on the same row. I've been reading so much about inline and block elements that my head feels like it's going to explode. It would look like this: Code: Picture - Header Text over here I'm not sure if everything should be span inside one class or what. I'm very confused. Please help a noob. 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 all, after my last query it was suggested that my use of absolute positioning for every element was not necessary. I should go with the flow. So I copied a basic page structure and twiddled a little. Here is the result so far html link css link A couple of questions. 1. Would you say I'm on the right track, or should I be looking at a different style structure? 2. The page appears in ie to have gaps around the elements. In Mozilla it looks like I hoped it would look. How to close up gaps in ie. I'm trying padding, margin, negative values etc, Checking in the morning in hope of miraculous fix. No luck so far. Any help, advice appreciated. Thanks Solar.. Hi, here's what i'm looking to do; i have a css style set for <ul> and <li> elements. Is there a way to bypass the styles for certain lists? Thank you in advance. |