我对整个html和css场景都是新手!我真正想做的就是有一个背景,中间的内容放置器和一个标题。一个例子就是:
http://img46.imageshack.us/img46/3751/38244782.png
请有人帮我做一些非常简单的事吗?感谢
答案 0 :(得分:3)
这是
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="headElement">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
</head>
<body>
<div id="marginWrapper">
<!-- Header -->
<div id="pageHeader">Header</div>
<!-- Body -->
<div id="pageBody">
<asp:ContentPlaceHolder ID="PageContent" runat="server" />
</div>
</div>
</body>
</html>
然后将其用作CSS
html, body
{
height: 100%;
width: 100%;
padding: 0;
margin: 0;
}
body
{
background: #F4F4F4 url('/_assets/images/backgr_grad.png') repeat-x 0 0;
color: #284E98;
font-family: Verdana, Arial, sans-serif;
font-size: 11px;
}
#marginWrapper
{
width: 950px;
height: 100%;
margin: 0 auto;
z-index: 1;
}
#pageHeader
{
background: #ffffff;
min-height: 76px;
max-height: 76px;
z-index: 1;
}
#pageBody
{
background: #ffffff;
z-index: 1;
}