CSS - Css And Horizontal Div Hack :)
Hey guys nice forums.....am a css noobie i wanna know one thing how do i make a div stretch horizontally 100% , basically i want my website to be divided into 2 colors black and white the lower part would be black and the upper part would be white , now am not using a div container as i read through previous topics before so am using 2 divs as follows
<div id="White">White area</div> <div id="Black">Black area</div> when i preview in IE i see the colors as i want but the divs do not stretch 100% as i said in the css. how do i do it ? hope i made myself clear on this Similar Tutorialswhen reading an identifier in CSS IE will treat two dots in a class decleration as one: accepted rules (strict mode): Code: win ie 5.01: p..class, p./**/.class win ie 5.5 : p..class win ie 6 : p..class, p./**/.class, p./**/class, p/**/.class win ff 1.5 : p./**/class, p/**/.class (comments ignored) win opera : (as firefox) win ns 7.0 : none! Hi all, I need some help. I know I need an IE hack to make my drop down menu on the header of this page work correctly (hover over 'pictures', 'rides', or 'maps') but for the life of me I can't seem to find what that workaround (hack) is. Please help! Oh yeah, of course, it work perfectly fine in Firefox. Here's a copy of the 2 CSS files I am using for this page... main2.css header.css And yeah, I am still working on the header, that's why it looks kinda empty right now. =) Manny nevermind got it sorted out Quote: hi, i just made a footer the other day and had to realize (at work today) that it is not quite there in IE where it is in FF. it seems to have to do with another element on the page (the navigation) - you will see what i mean by viewing the following page in IE: http://www.chocolateriewanders.com could you just tell me which one of the endless hacks for IE i need to apply - or how you call this alignment problem (then i can look it up in google myself ... i just need to know how you call this) thanks Yeah, we all know IE sucks because we have to do all types of extra css to make it work. I just did a design update on my site. I did my usual, worked the design with Chrome and Firefox. I got it all working with those browsers, and them I just opened IE 7 so see how much more work I need to do for IE. Well to my surprise, everything was correct. I checked IE 8. Same thing. It all looked correct. Now, I may have had a stroke and didn't know. So I'm asking if someone can look at my site with there IE 7 or 8 and confirm that looks alright. www. netgamegurus .com I just don't believe that I could have coded it that perfect. From my experience it just not possible. Sorry about the URL hack, but I came to this forum for css support and it's kinda hard to get css suport if we can't post URL's to show our css at work. Hello all, I'm really interested in hearing the opinions of those more seasoned in web development. I have been working hard at learning CSS and believe I have really improved my web design skills because of it. I love working with CSS and have completely freed myself from tables. But... I am so tired of playing for hours with the coding just so my page looks okay in both IE and FF. I'd much rather my page look great in FF (my prefered browser) and to heck with IE. I have made my stand and will no longer design my personal pages for IE. I have a clear message on one of them telling my visitors to wise up and download FF. Of course my audience allows me to get away with this. I realise that if your visitors are average surfers who barely know how to do a search on google, they aren't about to deviate from IE. But for those audiences who have a little more internet experience, do you think it's cool to try and push them into using FF? In terms of usage it's clearly on the rise, IE has been steadily declining. I'd really like to see IE hit bottom. The way I see it, as long us the development community continues to jump through hoops so people can keep using IE or other inferior browsers, there will be little motivation to develop some solid web browser standards. Any thoughts? So, I have an app that allows the user to select images from a list of thumbnails. The thumbnails have an 'on' and 'off' state, but also have a drop shadow. I can get the drop shadow to render nicely in IE6 using a PNG hack, but I can't seem to find a hack that will allow me to use a PNG sprite so I can have the on and off state in the same image. Any suggestions would be great. I've encountered the italics problem with IE and am trying to work around it. I followed the hack from the http://www.positioniseverything.net...alicbug-ie.html page but it really screws things up. My page is cut, more or less, into 3 sections: header, main, footer. Since I don't use any italics in either the header or footer, the rule needs only to apply to main. It CAN apply to the others, but it doesn't need to. Now, when I apply the hack, instead of my page lining up with the 'header' on the left hand side and the main on the right hand side, it completely pushes my 'main' area down so that it doesn't start until after the header and I have no idea why? I noticed that if I put the hack in each particular page (rather than in the external file sheet) then it works, but why? I read about a cross browser min-width hack he http://www.hackszine.com/blog/archi..._css_minhe.html Which seemed simple enough, but when I try it doen't seem to work. Here's my code Code: <a href="#" class="nav"><img src="/images/left.gif" alt="" />Next<img src="right.gif" alt="" /></a> Code: .nav { display:block; min-width:100px; width: auto !important; width: 100px; background-image: url(/images/btn_section_nav_bg.gif); } My end goal is to have a button that can expand to whatever width the text is inside it. Anyway TIA Here's how it works: first you make CSS rules like these, for example:
css Code: Original - css Code body { font-size: small; } body.0 { font-size: x-small; } #content { width: auto; } .0 #content { width: 100%; } body { and then you specify the class and id attributes: html4strict Code: Original - html4strict Code <body class="0"> <div id="content"> <body class="0"> The first of each rule targets strict standards mode, while the second of each rule targets quirks mode, including accidentental quirks mode due to a failure to read and parse the DTD. Why does it work? Because in standards mode, numeric classes (0, 1, 2, 23, 586, etc.) are correctly not applied to the rendered document, whereas with Quirks Mode in IE and Opera, these styles are parsed and applied. Technically the dot-zero rules will not validate, but the HTML will. So don't freak out if your CSS is flagged as invalid; this hack wasn't intended for standards mode anyway. Note: This hack will not work on Firefox, but since its default mode is not quirky, it doesn't matter. If you are having problems with Son of Suckerfish and IE7, where the drop down menu will not disappear like it should. Take out the javascript because you do not need it with IE7, but if you still want IE6 to work then put it in. For IE7, you need to add Code: *:first-child+html #nav { height: 1%; } *:first-child+html #nav li { height: 1%; } to your css and you will be fine. Don't ask me why, Don't ask how, i just chalk it up to just IE As I understand it, IE supports "hover" only when applied to a link, where with Firefox and Safari you can apply hover to any element. I am wondering if any of you know of a hack for IE to make hover applicable to any element. Below is my CSS. Code: .amy-navigation { padding: 30px 15px 0px 15px; height: 22px; float: right; } div.amy-navigation:hover { background-color: white; text-decoration: none; border-bottom: solid 1px #b1cc8d; } div.amy-navigation:hover > a { color: #acadac; text-decoration: none; } Using Firefox or Safari you can see what I'm trying to do in my header at www.amydelez.com I'm trying to apply the min-height hack for IE shown here http://www.greywyvern.com/code/min-height-hack.html It entails floating a 1 pixel wide box, then put your content below, then clear the float. It seems to work fine, but something in my layout is screwing this up royally on IE. Can someone take a look at this on IE and compare it to firefox. What in the world is IE doing here? http://section31.us/temp/rateyourmo...min-height.html That layout is just part of a larger website that i'm working on for fun. http://section31.us/temp/rateyourmovie.com/index1.php When the :not pseudoclass is used with an element selector in Firefox, it works as expected, excluding the selector inside the parentheses. But used by itself or attached to the * selector, it applies the rule to ALL elements. This unexpected behavior can be exploited to write Mozilla-specific patches to your CSS code. example:
html4strict Code: Original - html4strict Code <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <title>Testing :not Hack</title> <style type="text/css"> :not([id]) p { font-weight: bold; } </style> </head> <body id="thisthing"> <p>This is a test.</p> <p id="test">This is a test.</p> <div>This is a test.</div> </body> </html> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> The idea is to set the ID of the parent and browsers which correctly interpret this selector will not apply the rule to anything; also those browsers which don't already support it will simply ignore it. The :not selector is part of the new CSS3 recommendation. Here's just the css code for the hack: css Code: Original - css Code :not([id]) example { /* Moz/FF/Netscape code here */ } :not([id]) example { Hello, Is there a hack for Safari 3. I found this hack : @media screen and (-webkit-min-device-pixel-ratio:0) { #safari { display: block; } } The problem with this hack is that he is valid for all verison of Safari. My need is a hack only for Safari 3. Thank you in advance for your help. I have been having my share of problems with CSS lately for this one site I'm working on (this is my 3rd thread here about it) and now after researching I believe this one is from what I think is called a box model bug. The problem is this: The border heights for my <div>'s are perfect in FF but when I test in IE the are too long! below is my code and a url to the project. Code: * { margin: 0; padding: 0; } body { background-color:#FFFFFF; text-align:center; font-family:Arial, Helvetica, sans-serif; font-size:12px; color:#000000; } #site { width:775px; height:500px; margin:25px auto 0 auto; border:none; } #container { width:775px; height:500px; margin:0 auto 0 auto; border:1px solid #99CCCC; } #header, img { margin-top:10px; border:none; cursor: default; } #left { width:210px; height:201px; margin-top:80px; margin-left:20px; border-top:1px solid #99CCCC; border-right:1px solid #99CCCC; border-left:1px solid #99CCCC; float:left; } #menubar{ background-color:#FFFFFF; text-align:left; margin:0; padding:0; } #menubar li { display:block; font-family:Arial, Helvetica, sans-serif; font-size:12px; color:#FF9933; list-style:none; text-decoration:none; border-bottom:1px solid #99CCCC; cursor:default; line-height:27.5px; } #menubar a { display:block; font-family:Arial, Helvetica, sans-serif; font-size:12px; color:#FF9933; list-style:none; text-decoration:none; cursor:default; padding-left:5px; line-height:27.8px; } #menubar a.active { color:#99CCCC; } #menubar a:hover, #menubar a:focus, #menubar a:active{ color: #FFFFFF; background-color: #99CCCC; } #right { width:520px; height:390px; margin:15px 0 15px 0; border-top:1px solid #99CCCC; border-left:1px solid #99CCCC; float http://jjs5327.aisites.com/IMD311/index.html Does anyone have some suggestions that will make my sites <div>'s look the same in both IE and FF? Hey everyone, I'm tired, my back is sore and I can't find the damned list of hacks that fix various things in IE. I don't really know what is wrong, so I was just going to try random hacks to fix it, if anyone knows the list of the hacks that would be greatly appreciated. http://sammysnake.byethost7.com/ There is a screenshot of how it looks to me on that site, it's set to a min-width of 1000px. Okay, so, like, now I'm attempting to fix what I've got in IE (except IE on a Mac, that's a lost cause, I think, and demographically not something I need to worry about for this group) and I read up on the box model hack here http://www.communitymx.com/content/...0989953B6F20B41 (it explains all the hacks but promotes the Tan hack). I tried a hack in at least one place in the code, where I could handle the code (mathematically speaking), and it didn't effect any noticeable changes. My problem is that my head explodes when I try to figure out what to do when I have mixed units of measurement. Like, a width of 60% with padding of ems or pixels or something. The article didn't say what to do there, and frankly I need a calculator for basic math, so...what do you do in those cases? In their examples, they used consistent units of measurement. In IE, the content below the header is not really working, not the way it should or does in FF. For one thing, the .announcement box gets shoved to the bottom of the page, underneath #newsbox. http://www.describe.org/homework/esdcar/ http://www.describe.org/homework/esdcar/esdcar.css Also, why do the lines I used (dividing entries in #newsbox, for instance) change from skinny little lines to big fat wedges in IE? (And can I make it not do that?) Alright, I'm kind of new to css so maybe this is a really easy one. Ok, so I put a div in a div, like you are supposed to. On the outer div I defined margins, a height and a width. On the inner div I defined the padding and the border. However, it's not working because my inner div doesn't fill the whole space of the outer div like I thought it was supposed to. It only fills the amount of space the content in the inner div takes up. Thus, it stops a little short. So, I tried to be sneaky about it and put the height and width to 100% on the inner div. Well, this ALMOST worked, but in firefox for some reason it is actually filling the box TOO much to the right, so the inner box is about 10 pixels too wide (but only on the right side). Any idea what I'm doing wrong? Code: div.somediv { width: 160px; padding: 20px; _width /**/: 200px; } no tantek hack, no holly hack, no external css imports, just a shame it doesnt validate! if you see the css filters page at my site (http://www.cyclomedia.co.uk) you'll see that the 200px rule is only read by ie5 and ie5.5. but i havent done extensive cross platform (mac) testing, but it works for me! 1st off, how much do I have to worry about NN4 being used by web surfers? Wondering if I need to always be aware and adapt my pages to it. 2ndly, and most important, can someone help me with HOW to fix the below code. Have added the hack for IE mac/IE 5.x windows. But it screws up in IE6 by making the div extend to the right browser edge. How do I get it back in IE6? (Do I need to mention works fine in Firefox? ) **I have had to question my possible rudeness of posting the exact code in the book I am using for some CSS learning, along with mentioning the book by name. Thus, have stripped the code down to what's really important and deleted references to before said book. ** Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> <html> <head> <title>Dude</title> <style type="text/css" media="all"> body {background: rgb(75%,66%,66%); margin: 0; padding: 0; font: 12px/1.5 Verdana, Arial, sans-serif;} div#wrap {border: 2px solid black; background: white; position: absolute; margin: 0 80px 0 0; padding: 0 0 2em 0; left: 80px; right: 80px; top: 40px; voice-family: "\"}\""; voice-family:inherit; right: 0;} div#wrap img.curve {float: left; clear: left; margin: 0 15px 0 0; padding: 0; height: 20px;} </style> </head> <body> <div id="wrap"> <p>This div should be 80px from the right. After using hack for IE mac & IE 5.x win, <strong>IE6</strong> now stretches div all the way to the right. How do I make the hacks work and IE6 render correctly? I know I will run into this exact problem one day and best get it figured out now, huh?<p> <div id="menu"> <a href="link1.html">link</a><b> | </b> <a href="link2.html">link</a><b> | </b> <a href="link3.html">link</a><b> | </b> <a href="link4.html">link</a><b> | </b> <a href="link5.html">link</a><b> | </b> </div> </div> </body> </html> Thanks! James |