CSS和Firefox有时会出现问题

时间:2012-11-11 07:22:32

标签: html css

我开始布局一个网站,我在firefox中遇到麻烦,有时甚至会根据条件进行safari,例如在safari中,如果我在地址栏中输入页面,它将显示搜索div in标题边框的中间但是如果我再次突出显示地址栏并且我点击输入它会正确显示,如果我在所有内容都正确显示后单击刷新它将导致搜索框位于标题边框的中间并且还会登录div消失了。一切都很好用铬。在firefox中,提交按钮位于文本输入字段下方,无论我做什么似乎都留在那里。我的代码在http://jsfiddle.net/ES2Mz/以及以下地址:

<html>
    <head>
        <title>
        TESTING!    
        </title>
        <LINK href="CLLProfile.css" rel="stylesheet" type="text/css">
    </head>

    <body>

        <div class="container">

            <div id="header">
                <img src="http://www.placekitten.com/400/100">

                <div class="login"> 
                    <a href="http://www.signup.com">Sign Up</a> <a href="http://www.login.com">Login</a>
                </div>

                <div class="search">
                    <form id ="search" action="" method="post" enctype="multipart/form-data">
                        <label>Search:</label>
                        <input type="text" name="searchBox" id="searchBox" /> <input type="submit" id="Submit" value="Submit" />
                    </form> 
                </div>

            </div>

                <div class="content">
                    Here is the CONTENT 
                    <div class="profileInfo">
                        PROFILE INFO
                    </div>
                </div>

        </div>


    </body>

</html>​ 

CSS

body{
    background: gainsboro;

}

.container{
    padding-top: 20px;
    background: gold;
    width: 900px;
    height: 1300px;
    margin: 0 auto;

}

.content {
    background: #aad500;
    width: 800px;
    height: 1100px;
    margin: 0 auto;
    border: black solid medium;
}

#header {

    width: 800px;
    height: 150px;
    margin: 0 auto;
    background: #aad500;
    border: black solid medium;

}

#header img{
    position: relative;
    left: 50px;
    top: 25px;

}

.login {
    width: 350px;
    height: 35px;
    float: right;
    background: #aad500;
}

.search{
    background: #aad500;
    color: white;
    width: 250px;
    height: 20px;
    position: relative;
    margin-top: 10px;
    margin-left: 550px;
}

.profileInfo{
    background: whitesmoke;
    width: 750px;
    height: 800px;
    margin-top: 50px;
    margin-left: auto;
    margin-right: auto;


}

.login a{
    float: right;
    margin-left: 10px;
    margin-right: 20px;
    margin-top: 5px;
    font-size: large;
    color: whitesmoke;

}​

1 个答案:

答案 0 :(得分:0)

我解决了,我忘了添加<!DOCTYPE>