Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Sep 2004
    Posts
    713
    Thanks
    6
    Thanked 2 Times in 2 Posts

    css fine in firefox, but distore totally in ie

    my webpage is here

    http://www.yanmin.net/help/index.html

    this page is fine in firefox, but distore in IE, cannot center in the screen, cannot display properly, please help me if you free by right click and view source, all style sheet are there, if you can point out my mistake, i will be very appreciate
    flying dagger

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    This is partially your fault. You NEED a doctype or IE goes into quirks mode.
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    Add that to the top of your page. BTW there is also a WHOLE sticky about doctypes.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,668
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    Yes xiaodao, you need both a DocType and Character encoding.
    You should make the beginning of your markup read like this:
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>Untitled Document</title>
    <style>
    body{
    	background-color:#333;
    	font-family:tahoma;
    	font-size:12px;

    Then you should run it through the validator. See my sig below.


    One thing I noticed right off, you're using clear:both; a lot... it seems like maybe you want to clear your floats with it? In #main you have several floats that are not being wrapped by #main. Change that CSS to this:
    Code:
    #main{
    	overflow: auto;
    	width:745px;
    	padding:0px;
    	position:relative;
    	margin:0 auto;
    }
    overflow:auto; is clearing your floats now. To see the difference (view it in FF), put a background color on #main and look at it with and without the overflow setting.

    Overflow:auto; explained.

    ... one more thing, you may want to experiment with that character encoding. I have no experience with the language your using on your webpage.
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • #4
    Regular Coder
    Join Date
    Sep 2004
    Posts
    713
    Thanks
    6
    Thanked 2 Times in 2 Posts
    thanks, very thank you
    flying dagger


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •