Hey, I am working on a weather news website. I am using CSS and HTML. I have found a major bug in my code. Basicly It looks perfect in either firefox or Internet Explorer. I can basicly adjust the size attributes to make all the borders alligned correctly in firefox, but then its not aligned in IE. If i make it aligned right in IE, its not aligned right in firefox. Any help for be greatly appreciated. Thanks, Chris. Im not sure whats wrong. Here is the link to my page: http://weathernewschris.net78.net Here is the source code for my page: <html> <head> <title>WeatherNewsChris</title> <style type="text/css"> #header{ border:1px solid black; width:1000px; height:60px; } #content{ border:1px solid black; width:1000px; height:600px; } #navigation{ border:1px solid black; width:120px; height:660px; position:absolute; margin-top:10px; top:5px; margin-left:79px; } </style> </head> <body> <center> <div id="header"> </div> <div id="content"> </div> </center> <div id="navigation"> </div> </body> </html>
You will never get IE to attempt to perform like other more modern browsers without a proper doctype on the first line. Add this: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> Always use modern browsers, like Firefox, to initially test your markup. Then look to see if/when IE screws it up. The bugs and quirks of IE are well known, as are the hacks to fix it.
First things first, you need a doctype, which has been posted by DR. Then, if you really want to start 100% clean and even amongst the different browsers, I recommend you put this with all the other CSS code on your site. You will then have to add padding and margins to the divs to suit. /*RESET*/ body,div,dl,dt,dd,ul,ol,li,pre,form,fieldset,input,textarea,p,blockquote{ margin:0; padding:0; } table { border-collapse:collapse; border-spacing:0; } Code (markup): Also, get rid of the old deprecated <center> tags and stuff like that. You might want to run your page through a html 4.01 validator (search it on the web). Other then that, I suggest reading some more HTML tutorials to get your knowledge of semantic code and web design up. I apologize if that is too advanced for you or hard to implement, but it is 12:30am here. PM me if you have issues.
Hey, christopher785, pls try drhowarddrfine's advice first . He was right . Also, refer to my thread here http://forums.digitalpoint.com/showthread.php?t=936660