我想创建简单的 HTML。我想创建 3 个 div。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="generator" content="" />
<meta name="keywords" content="" />
<meta name="description" content="" />
<link rel="stylesheet" type="text/css" href="style.css" media="screen">
<title>My Site</title>
</head>
<body>
<div id="top_left">
</div>
<div id="top_center">
</div>
<div id="top_right">
</div>
</body>
</html>
center div 是固定大小的,总是在中间。但第一个和第三个 div 是动态的。这个怎么做。
CSS
#top_left {
background-image: url(images/pikacom_01.gif);
background-repeat: repeat-x;
background-position: left;
height: 85px;
}
#top_center {
background-image: url(images/pikacom_02.gif);
background-repeat: no-repeat;
background-position: center;
width: 1024px;
margin: 0 auto;
height: 85px;
}
#top_right {
background-image: url(images/pikacom_03.gif);
background-repeat: repeat-x;
background-position: right;
}