Jump to content
xisto Community
Sign in to follow this  
khalilov

Css With Ie

Recommended Posts

gameinfo{ position:absolute;top:200px;left:0px;width:300px;background:black;color:red;border:1px solid firebrick;text-align: center;}

This works perfectly with Firefox 3.0 but when i open it in IE it doesnt have any affect.

Share this post


Link to post
Share on other sites

Depending on how you'll use it you have to change it gameinfo in:

class (no specific element):

.gameinfo

class (specifix element)
div.gameinfo

id (only use gameinfo once)
#gameinfo

Share this post


Link to post
Share on other sites

I just use

<gameinfo>...</gameinfo>
it works with firefox but not IE, i can add a note asking users to download firefox but not all will do it, how do i make firefox and IE work with same CSS code?

Share this post


Link to post
Share on other sites

first off your CSS is missing a major component that being the selector for the CSS your trying to using. You would want to use either a class selector or id selector so you either want to use the following:

class selector set up

.gameinfo{ position:absolute;top:200px;left:0px;width:300px;background:black;color:red;border:1px solid firebrick;text-align: center;}

ID selector set up
#gameinfo{ position:absolute;top:200px;left:0px;width:300px;background:black;color:red;border:1px solid firebrick;text-align: center;}

Class selectors are used for more then one style using the same set up while ID selector is used for one specific part of your html. I also agree how were you able to use <gameinfo> and get something going in firefox since that is not a working html or CSS tag.

Share this post


Link to post
Share on other sites

Yeh its funny it worked with firefox lol, anyways now iam using classes and its working with IE and fire fox exept in some areas, some boxes appear closer/higher/lower in firefox than IE. Is this normal?

Share this post


Link to post
Share on other sites

Yes, that quite normal. Every object has default values (font-size, line-height, color, margin, padding, ...), but W3C does not define what these default values should be, so every browser has it's own sets of default values. You simply have to make sure that you define them and thus overriding the (different) default value.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.