Hello fellow Web Designers - there is no real place where this belongs, there is a graphics discussion, general discussion but no Web Development discussion :blink: What do you all think are the pros and cons of using "Float:left;right; or whatever" Compared to "Position:absolute;relative;" etc... Personally I always use float. When i first learned CSS - someone was kind enough to teach me, and I was taught using floats. I always have. However when doing more complex layout I come across some browser issues. For example the website which I am currently working on http://wonderboy.mythicx.com/counterstrike (coding it for a client) it works perfect on Fire Fox, but not on any explorer version. I was just wondering if i changed the way I postioned things would that effect browser compatibility - Eg) Using absolute positioning instead of floats, would this change the way that it is viewed in some browsers ? Just something I'm wondering because it annoys me sometimes that you can spend house coding a Website, view it on Fire Fox and you think "YES" done - you feel proud of what you have "hand coded". Only to look at it in Internet Explorer and see that it's messed up. /sigh. I think/know it's something to do with margins and padding, the way they are rendered. What I don't understand is WHY they render them differently. EG) margin-left:10px; now no matter what browser is rendering it, 10px is 10px! So why does it look so different ? Same with padding, 10cm in the UK is still 10cm in France... if you see what I mean. Thanks my rant over, Wonderboy.
it looks good in my internet explorer..but when i refreshed the page everything shifted hmm wish i could help you with that
When using position:absolute its even worse. You define top:xxpx; left:xxpx; If the browser is resized, it still keeps those measurements so It wouldn't look right. also different resolutions means a content box maybe centred on a 1024x768 screen but not on a 1280x1024 screen. Browsers have built in stylesheets, which automatically define elements with certain properties. I assume you already knew that Do you know anything about the box model? Check this if you havn't
Thats quiet a nice template, Seems fine in firefox as it looks in IE and it seems different lol Arbiter
Yea it's the hardest one i have ever coded It was fun. Phil: Yes i have heard of the box model, not went into it in great detail before though. So absolutex; is even worse... ? :blink: Yea i know what you mean about if you were to resize the window, it would look worse using postion: rather than float. What do you use Phil ? It's annoying, all browsers should render CSS the same way, it would make it much simpler. Merged Post: Internet explorer 6 and 7 are not effected by the box model anyway, are they ?
I personally just hate IE. I have a template I coded in full CSS and everything is just crap in IE. I personally use float, but the margins and everything, placement, is just different from IE and FF. I know that in my current website template, I'm coding it in Tables just because of the fact that it looks horrible in CSS. Or I might just get someones help.
Yea i know what you mean. The code for the one i'm working on at the moment is 100% valid, but it still messes up in IE - margins,padding etc... it's stupid to be honist. I could make a different stylesheet for IE6, then another one for IE7 but surely there is an easier way ?
Well yeah. All my coded validates CSS. The only easier way is practicing CSS coding. Just testing codes to work in both browsers. I don't suggest making another stylesheet for IE and IE7 only because there is no point. It would be a waste of time. You just gotta practice. Once it works once, it should work good.
It's not my CSS thats the problem though, it's the way IE render CSS. Just don't know what adjustments i can make to make it work, even a little better than it does. Merged Post: I'm talking about in general, not just the template i posted about. That was just a good example.
you can do conditional formatting <!-[if IE 7]> <link rel="stylesheet" href="IE7.css" media="screen" /> <![endif]--> But if you understand the technique i showed you Wonder you shouldn't have to use too much conditional formatting
Yea i have used that before, i have one website which has about seven different style sheets, but it's just annoying that you need a sperate style sheet for each browser... Actually come to think about it, it was <!--[if IE 6]> <link rel="stylesheet" type="text/css" href="ie6-style.css" /> <![endif]--> I used, yours has media="screen" in it, whats that used for ?
So does it matter which is used ? <!-[if IE 7]> <link rel="stylesheet" href="IE7.css" media="screen" /> <![endif]--> or <!--[if IE 7]> <link rel="stylesheet" type="text/css" href="ie6-style.css" /> <![endif]--> or... <!--[if IE 7]> <link rel="stylesheet" type="text/css" href="ie6-style.css" media="screen" /> <![endif]-->
The first one or the second one will work fine. That is the best way to do things for a cross-browser site. Define everything in the main css file, and then if the user has IE 7 or IE 6, load up a css file that contains different information and measurements for the site. Also, absolute isnt exactly the best way to go. It can cause serious alignment issues when viewing in different resolutions sometimes. Relative and float is the best way to go. If you need to move something, use padding or margins.
i havent read the whole topic, only the first post, so excuse me if i reapeat something that has been said before. What i alsways do when creating a website in css.. i open 1 instance of IE6 1 of IE7 and 1 of firefox. And i just start creating it, after every small change i make, i watch all browsers if its still ok... if it is, i continue, if it isnt i try to fix it in the same stylesheet, if that doesnt work i use diffrent stylesheets for diffrent browsers, i assume you already knew that, but if you didnt, it works like this: Code: <!-[if IE 7]> <link rel="stylesheet" href="style_IE7.css" /> <![endif]--> And same for ie6: Code: <!-[if IE 7]> <link rel="stylesheet" href="style_IE6.css" /> <![endif]--> Good luck!