Reply
CSS in IE and FireFox
Old 03-04-2007, 03:36 AM CSS in IE and FireFox
Extreme Talker

Posts: 174
Here is the css for IE

HTML Code:
<style type="text/css">
body {background: #b28945;}
.img1{position:absolute;top:0;left:0;width:984;height:1400;}

.div1{background: black; position:absolute;top:444;left:27;width:270;height:842; overflow:auto; }
.div2{background: black; position:absolute;top:442;left:365;width:578;height:842; overflow:auto; }

</style>
And here is the css for Fire Fox


HTML Code:
<style type="text/css">
body {background: ##BA9451;}
.img1{position:absolute;top:0;left:0;width:984;height:1400;}

.div1{background: black; position:absolute;top:444;left:27;width:270;height:842; overflow:auto; }
.div2{background: black; position:absolute;top:442;left:365;width:578;height:842; overflow:auto; }

</style>
I would like to know how to have my firefox css and ie css code wirking in those browsers.

(one css for ie7 and another for firefox) maybe javascript or something.
simster is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Old 03-04-2007, 04:21 AM Re: CSS in IE and FireFox
Insensus's Avatar
Ultra Talker

Posts: 275
Name: Mark Stegeman
Location: Netherlands, Europe
You'll have to use conditional comments for that I guess.
I'm not aware of how they work though.
It's explained in this topic:
http://www.webmaster-talk.com/javasc...tylesheet.html

Regards,
Insensus
__________________
<?php ($helpfull>0)?$talkupation++ : '';?>
Insensus is offline
Reply With Quote
View Public Profile
 
Old 03-04-2007, 04:25 AM Re: CSS in IE and FireFox
OmuCuSucu's Avatar
Vi Veri Veniversum Vivus

Posts: 1,167
Name: Dragos-Valentin
Location: Cluj-Napoca, RO
you only have background color different ... i don't see any point in using code twice. just use the conditional comments as descibed in the post Insensius gave you, but i suggest using them only for the differences
__________________
.
» Please remember to add to my Talkupation if you enjoyed my post. Thank you :)
.
OmuCuSucu is offline
Reply With Quote
View Public Profile
 
Old 03-04-2007, 05:50 AM Re: CSS in IE and FireFox
Extreme Talker

Posts: 174
can some one give me the code because i cant use php code on my free site

Last edited by simster : 03-04-2007 at 05:58 AM.
simster is offline
Reply With Quote
View Public Profile
 
Old 03-04-2007, 06:45 AM Re: CSS in IE and FireFox
Insensus's Avatar
Ultra Talker

Posts: 275
Name: Mark Stegeman
Location: Netherlands, Europe
It isn't PHP:

Code:
<!--[if lt IE 7]>
call your style sheet here
<![endif]-->
__________________
<?php ($helpfull>0)?$talkupation++ : '';?>
Insensus is offline
Reply With Quote
View Public Profile
 
Old 03-04-2007, 02:48 PM Re: CSS in IE and FireFox
Extreme Talker

Posts: 174
in the css stylesheet (end with .css) do i need style tags or whatever
simster is offline
Reply With Quote
View Public Profile
 
Old 03-04-2007, 03:08 PM Re: CSS in IE and FireFox
Insensus's Avatar
Ultra Talker

Posts: 275
Name: Mark Stegeman
Location: Netherlands, Europe
I don't see what you mean, I'm afraid.
__________________
<?php ($helpfull>0)?$talkupation++ : '';?>
Insensus is offline
Reply With Quote
View Public Profile
 
Old 03-04-2007, 03:20 PM Re: CSS in IE and FireFox
Angelosanto's Avatar
Ultra Talker

Posts: 440
Name: Danny Angelosanto
NO! Don't use style tags in your stylesheet. It's not necessary to use them unless the stylesheet is contained within the HTML page.
Angelosanto is offline
Reply With Quote
View Public Profile Visit Angelosanto's homepage!
 
Old 03-04-2007, 08:44 PM Re: CSS in IE and FireFox
Extreme Talker

Posts: 174
and what code do i use to embed to .css stylesheet
simster is offline
Reply With Quote
View Public Profile
 
Old 03-04-2007, 09:52 PM Re: CSS in IE and FireFox
taketherisk's Avatar
Skilled Talker

Posts: 88
Name: Brett
Location: New Zealand
hi,

Heres the code:
Code:
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="stylesheet.css" />
<![endif]-->
But i don't see why you are making another file for IE. You could just have:

Code:
<!--[if lt IE 7]>
<style type="text/css">
<!--
body {background: #b28945;}
-->
</style>
<![endif]-->
Hope this helps

-Brett
__________________
My Sites:
Free Domain Names
Free Web Hosting
taketherisk is offline
Reply With Quote
View Public Profile
 
Old 03-05-2007, 11:14 AM Re: CSS in IE and FireFox
AliKat's Avatar
Extreme Talker

Latest Blog Post:
Beginning Ajax with PHP
Posts: 161
Location: MS
I could be wrong but I'm pretty sure you need to include units in your heights and widths to be standards compliant.
AliKat is offline
Reply With Quote
View Public Profile Visit AliKat's homepage!
 
Old 03-05-2007, 01:52 PM Re: CSS in IE and FireFox
LadynRed's Avatar
Super Moderator

Posts: 6,539
Location: Tennessee
Quote:
I could be wrong but I'm pretty sure you need to include units in your heights and widths to be standards compliant.
You are correct, but it's not just for standards compliance, it's good practice.

Conditional comments should be used to target the IE browsers. I have 3 css files on my sites: 1 for FF and all the 'good' browsers; 1 for IE 6 and below; 1 for IE 7. The ONLY thing contained in the IE 6 and 7 css files are the rules needed to make IE behave, nothing else.

Yes, you have multiple files, but it is minimal and the secondary files are not complete duplicates of the main css file.

Simster, why are you using all that absolute positioning ?? Generally not a good idea at all.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!
"Using or working with IE is like having to wear a 1970's polyester suit with pantyhose and a girdle, to work everyday"
Carolina Corvette Club
LadynRed is offline
Reply With Quote
View Public Profile
 
Old 03-05-2007, 10:17 PM Re: CSS in IE and FireFox
Extreme Talker

Posts: 174
im making a div site
simster is offline
Reply With Quote
View Public Profile
 
Old 03-06-2007, 01:22 PM Re: CSS in IE and FireFox
LadynRed's Avatar
Super Moderator

Posts: 6,539
Location: Tennessee
Quote:
im making a div site
Huh ? We know that, and my comment is only relevant to a table-less site.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!
"Using or working with IE is like having to wear a 1970's polyester suit with pantyhose and a girdle, to work everyday"
Carolina Corvette Club
LadynRed is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to CSS in IE and FireFox
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.18884 seconds with 12 queries