CSS - Html>body Ie Cheat Doesn't Seem To Work Anymore?
I've been using the html>body cheat to fix IE issues for over a year now, to fix issues with margins mostly. Lately for some reason, it doesn't seem to work anymore. For the life of me I can't figure out if I'm doing something wrong or not. Here's a sample of what I'm working on right now:
Code: .image a { display: block; width: 154px; height: 84px; border: 1px solid black; overflow: hidden; float: left; background-image: url(_images/loading.gif); margin: 5px; } .image img { border: 0; } .image a:hover { border: 5px solid #FC0; margin: 1px; } .image a:focus { width: 170px; height: 96px; border: 10px solid red; margin: -12px; } What's going on is I created a 4 x 4 grid of images, when you mouse over them a 5px orange stroke surrounds the image, and when you click the image, the image "enlarges" and gets a 10px red stroke. It's working great in Firefox, but then in IE, because of the margins, images shift when you mouseover, and the red stroke doesn't appear when you click. Any ideas? Thanks. Similar TutorialsHi. I want to set my page's background colour through an external stylesheet. I have this: Code: body { background-color: #CAB284; text-align: center; } But it doesn't affect my page. I'm using it in firefox. Every thing else in the stylesheet works correctly except this. When I enter this stuff in the actual body tag of the page using style="" it works though. I don't want to do it that way as it takes longer to change everything when I find a better background colour. Can anyone help? Thanks, Matthew I can only get margin to work with the body element. border & padding don't. Can someone explain why pls. 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>Untitled Document</title> <style type="text/css"> body { margin: 0px; border: 10px; } </style> </head> <body> <div>This is some text</div> </body> </html> Also, i get the same result if I define a simple class and use div. e.g. .myclass { margin: 0px; border: 10px; } <div class="myclass"> some text </div> Only the 'margin' works within the class. Hi. In my external style sheet i have this: Code: body { margin-left: 100; margin-top: 0; margin-right: 0; margin-bottom: 0; } I am completely new at CSS and am only doing it because supposedly my tables are out of fashon! Thanks Matt Hi folks, don't usually post in the CSS forum here, but in the php forum I have got great help so give it a go. Basically I need to know how to center two divs on a page which themselves have float:left attribute. When I set text-align:center on the body a couple of other divs aligned perfectly so I did not have to worry about different res's. But I need these two divs (leftnav and content) next to each other and acheived this by setting the float:left attribute. The CSS code is below, I hope you can help, i have tried but these two divs in one outer div (without any float set) but didn't work. Code: body { font-family: "Lucida Sans"; font-size: 12px; margin: 0px 0px 10px; border-top: 0px none #000000; border-right: 0px none #000000; border-bottom: 5px none #000000; border-left: 0px none #000000; scrollbar-arrow-color: #D20000; scrollbar-3dlight-color: #4F4F82; scrollbar-darkshadow-color: #4F4F82; scrollbar-face-color: #f4f4f0; scrollbar-highlight-color: #FFFFFF; scrollbar-shadow-color: #d0d0d0; scrollbar-track-color: #ffffff; text-align: center; display: block; } .leftnav { float: left; color: #000000; font-size: 12px; font-family: "Trebuchet MS"; border-top: 1px solid #000000; border-right: 1px none #000000; border-bottom: 1px none #000000; border-left: 1px none #000000; padding: 0px; white-space: nowrap; width: 220px; margin: 10px 0px 0px 10px; clear: both; text-align: left; } .content { background-color: #FFFFFF; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #000000; border-right-color: #000000; border-bottom-color: #000000; border-left-color: #000000; float: left; white-space: normal; margin-top: 10px; margin-left: 0px; margin-bottom: 10px; font-family: "Trebuchet MS"; font-size: 13px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; width: 1000px; margin-right: 0%; list-style-type: none; text-align: left; } Thanks very much. I'm going mad with this, I tested the CSS a:hover function over FF 1.0.7 and IE6, and the style file is simple: PHP Code: h3 { margin:10px; color:#636500; font-family: Arial, Helvetica, sans-serif; font-style: normal; } p { margin:10px; color:#636500; font-family: Arial, Helvetica, sans-serif; font-style: normal; } a { text-decoration: none; } a:hover { color:#636500; } a:visited { color:#cecf9c; } a:link { color:#cecf9c; } searched through the forum but seems nobody has got this problem... I just want the link to change color, I imported the css file to my html and it worked for the first time. I clicked on the link and then use brower's "Back" button to test it again, but the hover feature is not working anymore. I think it may be affected by the a:visited style, but how do I make a:hover work all the time? Thanks for helping. (please note, i'm a noob).. What i have right now: ################ HTML: ################ <div id="aboutusimage"></div> ################ CSS: ################ #aboutusimage { width:400px; height:75px; background-image:url(/images/about.jpg); position:relative; left:189px; top: 4px; margin-bottom:30px; } ======================== What i'd like to have: ################ HTML: ################ <div id="banner" class="about"></div> ################ CSS: ################ #banner { width:400px; height:75px; position:relative; left:189px; top: 4px; margin-bottom:30px; } #banner.about { background-image:url(/images/about.jpg); } ====================== For some reason, the image disapears when i do this :\ Any advice? Hi there, Sorry for being silly and pathetic and crap at CSS, but I'm having an issue with a site I've been working on. Site URL is here, and the issue that I am having is as follows: I have a layer with a cloud as it's background. It's the one in the centre, called layer1 because I didn't bother renaming it. Because of the background being a cloud, the edges are curved, like a fluffy cloud would be. Obviously any text in this layer will overrun the edges of the cloud, and so I thought it would make sense to use padding to trim the text area down so it would all fit on the cloud. Now the problem that I am having is that while padding the left side works, padding the right side appears to have no effect :-( If anyone's got any hints or tips that might solve my proble, I'd be reeeeally grateful! Regards, Lawrence Hi guys, I've trying to achieve the following. I want to have a div element floating on the right 100px from the top and the rest of content is filled with text. PHP Code: <div>[image]</div><p>text 1</p><p>text 2</p> I could do this easily with simple float:right but then the image would at 0px from top and if I try to move it down (using margin or padding) the text wouldn't reach above it (would get cut off at the width of the image form the right) If I try to add another div with 100px height and 10px (for example) width above the image, the text overlaps over my image div Any ideas how to achieve this? Below is my full html code PHP Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"> <html > <head> <title>float</title> <style type="text/css"> .content { width: 400px; background: #FFFF00; padding: 5px; } .floatright { float: right; height: 100px; border: 1px solid #000; } .offset { width: 10px; } .imgholder { width: 100px; clear: right; } </style> </head> <body> <div class="content"> <div class="floatright offset"></div> <div class="floatright imgholder"><h1>image</h1></div> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam posuere. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras ornare. Vestibulum a nulla id velit elementum imperdiet. Nam a purus. Suspendisse non enim. Nullam id sem. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Maecenas aliquet varius tellus. Aliquam sed nunc eu tortor semper vulputate. Nunc risus. </p> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam posuere. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras ornare. Vestibulum a nulla id velit elementum imperdiet. Nam a purus. Suspendisse non enim. Nullam id sem. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Maecenas aliquet varius tellus. Aliquam sed nunc eu tortor semper vulputate. Nunc risus. </p> </div> </body> </html> My site works fine with Opera 7 but refuses to work properly with IE6 and Firefox. There's definately a problem with how each browser renders my CSS. I for one cannot figure out what to change so that the site would work with all three browsers. That being said, would anyone be grateful enough to help me out? Thanks! URL: URL I've included some screenshots of how the site looks like on all three browsers. URL URL URL I'm wondering why does the padding doesn't work for the <p> tag... Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <style type="text/css"> p.pFrontPageTitle { margin: 0px; padding: 200px 0xp 200px 0px; color: #000000; font-weight: bold; font-family: verdana; font-size: 12pt; font-style: normal; background-color: #FF0000; } </style> </head> <body> <p class="pFrontPageTitle">What Our Customers Say .....</p> </body> </html> This is my CSS File: PHP Code: .linkbody { padding: 15px 15px 6px; color: white; font-family: Verdana; font-size: 10pt; width: 160px; background-color: #006EA1; } and this my html file: Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <HTML> <head> <title> Schmid </title> <link type="text/css" rel="stylesheet" href="css2.css"> </head> <body> <center> <table class="linkbody" width="800"> <tr> <td> ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd </td> </tr> </table> </center> </body> </HTML> In Firefox the padding works fine, but in the IE6 it doesn't work at all makes me angry thx for any help Hi guys Look here www DOT clickemarketing DOT com The date, before each article, should show at right. This date uses the .createdate css class, which is this Code: .createdate { color: #A9A9A9; vertical-align: top; padding-bottom:2px; float: right; font-size: 11px; } I don't know why IE shows it at left... FF shows ok Is there any way to correct this class, and make date show at right in this pseudo browser, worm collector, spyware downloader called IE ? Thanks http://www.invalidheart.org/carrie/ it doesn't work in anything but my resolution... can anyone help me fix this? I've had a huge hard time with this layout making it fit right, i tried using all css and i couldn't get it to fit. any suggestions? Hi All, We develoepd an Application for a client. This application uses CSS for all text including drop-down menu text and input box text. My client is using XP as their OS and he tells me (sent a screen capture as well) he CANNOT read the drop-down boxes. Text is too small. On our machines (Win 98) there are no problems. Have tested on about 15 different client computers with no problems. Browser is not an issue as its the same for him on both Netscape and IE. Does ANYONE have a clue how to fix this? Doesn't seem logical to me - one OS should be the same as the other. However, we're talkin about MS products and who knows with them. Need urgent help on this one.. please.. anyone with ideas help me! thanks all. Peace. Aaron On my re-design of www.samuraiblog.com , I have a DIV that has quite a bit of text in it. I have it set to 100%, but it only goes about 1/4 of the way. You can see what I mean here, on a test server, http://samuraiblog.dreamhost.com/index.php Thanks, -Sam Hi, link to wesbite why doesn't the drop down menu, that works in IE6 not work in Firefox 0.8? It is pure CSS, no Javascript. OK, I know it doesn't validate and don't care too much about that. I know putting tables inside an anchor tag is frowned on but hey, it works and I didn't think it up. I thought IE was the worst when it came to CSS compliance? Any ideas how I can fix it? Thanks, John Hello. I am new to css and i made the following h1{ position:absolute; left:850px; top:300px; color:green; } I put this in a form that i wanted to be shown at the right bottom of my screen and in mozzila it worked fine, but i found out that in internet explorer it didn't and in general i coudn't view right anything that had specific positions. Is there a bug? Hi, Is there a good way to use css to make every element with a specified class name to have some hover attribute, for instance .class:hover would do something? For some reason it doesn't work for me unless I say div.class:hover or a.class:hover, etc. I have to specify an element. Hi all, A simple problem he http://ntcjapan.com/contactus_apply.php The page validates under W3C, but CSS validation fails. It's because of the following Javascript on the page: Code: if (!(isWhitespace(form.from_email.value)) && !(checkEmail(form.from_email.value))) { alert("Please enter a valid email address."); form.from_email.focus(); return false; } The && is causing problems with CSS validation - any idea how I can bypass this? Thanks in advance Hi, I need some links to have a specific color. a.ClassName:link works in FF but not in IE. Is there are work-around? PHP Code: .chatlistmale, .chatlistfemale, .chatlistcouple { display: block; border: solid; border-width: 1px; width: 200px; } a.chatlistmale:link { background: #006699; } a.chatlistmale:active { background: #006699; } a.chatlistmale:visited { background: #006699; } a.chatlistmale:hover { font-weight: bold; } a.chatlistfemale:link { background: #FF0033; } a.chatlistfemale:active { background: #FF0033; } a.chatlistfemale:visited { background: #FF0033; } a.chatlistfemale:hover { font-weight: bold; } a.chatlistcouple:link { background: #00FF00; } a.chatlistcouple:active { background: #00FF00; } a.chatlistcouple:visited { background: #00FF00; } a.chatlistcouple:hover { font-weight: bold; } |