出于某种原因,我在示例图像中的元素不会与页面顶部对齐。我有一段时间没有使用 HTML/CSS,但我看不到任何可以将矩形向下移动约 5px 的编码方式。
我正在尝试在此页面上实现栏:http: //gradients.glrzad.com/
这是我的代码。HTML:
<!DOCTYPE "html">
<html>
<head>
<title>Mobile Site</title>
<link href="mobileCSS.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="titleBar">
<strong>Coles Web</strong>
</div>
<div id="container">
</div>
</body>
</html>
CSS:
@charset "utf-8";
/* CSS Document */
body{
background-color:#666;
}
#container{
width:auto;
}
#titleBar{
position:fixed;
position:relative;
width:auto;
height:15px;
text-align:left;
font-family:Verdana, Geneva, sans-serif;
font-size:small;
color:#00FFFF;
background-color:#000;
box-shadow:0 3px 5px #333333;
border-bottom-left-radius:3px;
border-bottom-right-radius:3px;
}
.bubble{
width:auto;
height: 40px;
position:relative;
border-spacing: 3px;
background-color:#0FF;
border-radius:3px;
font-family:Impact, Verdana, Geneva, sans-serif;
text-align:center;
}
提前致谢!