Niixie Posted May 11, 2011 Share Posted May 11, 2011 Hey peeps, i got a problem with my CSS code. When viewed in Firefox it looks right, but when i look at it in IE it's totaly fucked up! Its supposed to be a red background with text in it, but its just text spread all over the top of the screen. Can you help me? This is my CSS code for the part thats wrong; error { font-size: smaller; background-color: #ff0000; padding: 5px 10px 5px 10px; margin-top: auto; position:absolute; } Quote Link to comment Share on other sites More sharing options...
Niixie Posted May 11, 2011 Author Share Posted May 11, 2011 Anything in my CSS that's not allowed in IE? Quote Link to comment Share on other sites More sharing options...
Niixie Posted May 11, 2011 Author Share Posted May 11, 2011 I assume nobody knows? Quote Link to comment Share on other sites More sharing options...
cssfreakie Posted May 11, 2011 Share Posted May 11, 2011 I assume nobody knows? that's an interesting assumption, considering you posted this an hour ago. do you have it on line somewhere. i am pretty much some more things and needed to say what is wrong. By the way if you have a class of error. put a dot in front of it .error{property:xxx;} Quote Link to comment Share on other sites More sharing options...
Niixie Posted May 11, 2011 Author Share Posted May 11, 2011 I assume nobody knows? that's an interesting assumption, considering you posted this an hour ago. do you have it on line somewhere. i am pretty much some more things and needed to say what is wrong. By the way if you have a class of error. put a dot in front of it .error{property:xxx;} Sorry and thanks for asking. Its not a class, but a "function", the line that calls it looks like this echo '<error>ERROR '.$errorid.': '.$errors[$errorid].'<br /><center><a href='.CurrentURL().'>Close</a></center></error>'; Its from my php function. Quote Link to comment Share on other sites More sharing options...
efficacious Posted May 11, 2011 Share Posted May 11, 2011 a proper doc type declaration will solve alot of your cross browser issues.. do you have one set? also you may need to reset all the margins and padding at the beginning of your code.. so that your positioning code will be more accurate in each browser Quote Link to comment Share on other sites More sharing options...
cssfreakie Posted May 11, 2011 Share Posted May 11, 2011 also: Unless i am unaware of it <error> </error> doesn't seem valid to me Can't you instead use a <span class="error"> and put the code inside that and in css do: .error{ yourproperties:xxxx; } Do you have this somewhere online? so we can have a look... Quote Link to comment Share on other sites More sharing options...
Niixie Posted May 11, 2011 Author Share Posted May 11, 2011 Yes, and i've searched ALOT, and now i got the one that validated my site green with w3 validator Its <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> also: Unless i am unaware of it <error> </error> doesn't seem valid to me Can't you instead use a <span class="error"> but the code inside that and in css do .error{ yourproperties:xxxx; } Do you have this somewhere online? so we can have a look... No its only localhost, sorry. -I'll try to make it span insted. Quote Link to comment Share on other sites More sharing options...
cssfreakie Posted May 11, 2011 Share Posted May 11, 2011 a good habbit is to run your code through the validator, i bet this error tag will pop up as invalid Quote Link to comment Share on other sites More sharing options...
Niixie Posted May 11, 2011 Author Share Posted May 11, 2011 The error tag will be an error yes, but i made it. so i ignored it. If i change error to span it changes, but then in firefox looks like IE Quote Link to comment Share on other sites More sharing options...
efficacious Posted May 11, 2011 Share Posted May 11, 2011 whats the parent element of this error element? its at the top of the screen because its set to absolute positioning and I'm betting that your "intended" parent element is not set to be relative. yea i've never heard of an <error> element so i'm assuming thats wrong for sure.. <div id='error' name='error' class='error'>Something like this maybe</div> Quote Link to comment Share on other sites More sharing options...
Niixie Posted May 11, 2011 Author Share Posted May 11, 2011 I changed it to div now, no more <error></error>. But now all the other stuff is pulled to the left side of the screen when box is appering? Quote Link to comment Share on other sites More sharing options...
efficacious Posted May 11, 2011 Share Posted May 11, 2011 so whats your html/css code look like now? post the container and its code for the element in question as well plz. Quote Link to comment Share on other sites More sharing options...
cssfreakie Posted May 11, 2011 Share Posted May 11, 2011 I changed it to div now, no more <error></error>. But now all the other stuff is pulled to the left side of the screen when box is appering? do you have this somewhere online (so we can see what you do), also why do you make it a div?? a div is a block element. if you want to stick with a div give it a float. and again i recommend a span, because this is probably only for some error message. Quote Link to comment Share on other sites More sharing options...
Niixie Posted May 11, 2011 Author Share Posted May 11, 2011 When i used span it only made it worse? I made it span now, without fucking it up. But its still smashed up in IE? Its not online, sorry. Quote Link to comment Share on other sites More sharing options...
cssfreakie Posted May 11, 2011 Share Posted May 11, 2011 When i used span it only made it worse? :'( put it online somehwere on a free host, or hope for some visionaries. I can't fix this without seeying anything useful. Quote Link to comment Share on other sites More sharing options...
Niixie Posted May 11, 2011 Author Share Posted May 11, 2011 PM Quote Link to comment Share on other sites More sharing options...
cssfreakie Posted May 11, 2011 Share Posted May 11, 2011 it's the docytype which is not first in the browser, also the error message is outputted above it. right click view source to see it. IE jump it to quirks mode if the doctype is invalid or not at the very top Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.