无法在html中设置最顶部区域的颜色,并且它也从侧面保持无色

时间:2015-11-22 07:50:21

标签: html css css3

我正在以干净的方式编写此代码,请尽快帮助我找到正确的解决方案。

请参阅附图,以便更好地了解问题。

代码编写: -

在HTML中:

<!DOCTYPE HTML>
<html>
<head>
<title>Sign-In</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body id="body-color">

    <div id="heading">
        <p style="color: white">
            CONNECT-U
        </p>
    </div>

<div id="signin">
<fieldset style="width:30%"><legend>LOG-IN HERE</legend>
<form method="POST" action="connectivity.php">
User-ID <br><input type="text" name="user" size="40"><br>
Password <br><input type="password" name="pass" size="40">
<br>
<br>
<input id="button" type="submit" name="submit" value="Log-In">
</div>
</form>
</fieldset>
</body>
</html> 

IN CSS:

#body-color{
background-color:#6699CC;
}
#heading{
    margin-top:0em;
    margin-bottom: 0em;
    margin-left: auto;
    margin-right: auto;
    font-size:2em;

    background: #696969

}
#signin{
margin-top:207px;
margin-bottom:207px;
margin-right:434px;
margin-left:434px;
border:3px solid #a1a1a1;
padding:9px 35px; 
background:#f8f8ff;
opacity: 1.5;
width:400px;
border-radius:20px;
box-shadow: 7px 7px 6px;
}
#button{
border-radius:10px;
width:75px;
height:37px;
background:#6495ed;
font-weight:bold;
font-size:20px
}

THE TOP MOST AREA IS OF COLOR AS THE BACKGROUND COLOR,I WANT IT TO BE LIKE THE COLOR OF BACKGROUND OF THE HEADING

1 个答案:

答案 0 :(得分:0)

首先将Array添加到您的margin: 0px;

#body-color

然后删除段落中位于#body-color{ background-color:#6699CC; margin: 0px; } div

中的上边距
#heading