我一直在寻找如何做这一整个星期,没有用,我想创建这样的博客设计: http : //www.bedinthekitchen.co.uk其中背景就像一个框架和内容是白色..当我添加背景时,它会整理整个页面,内容是透明的。
Here is a really quick recreation of the layout for the website you posted a link to.
<!DOCTYPE HTML>
<head>
<title>Blog</title>
<style>
body {background-color:#F7D4B0;}
#content {background: white; width:1100px; height:500px; margin:100px auto;}
</style>
</head>
<body>
<div id="content">
<h1 style="text-align:center;">Blog</h1>
<p style="text-align:center;">Content</p>
</div>
</body>
</html>
You can change the background of the body to whatever you want. As long as you keep all of your content within the "content" div, which has a background set to white, you should be set.
To prevent your background from tiling do the following:
html{
background: #fff ("../image/mybackgroundimg.jpg") 0 0 no-repeat fixed;
background-size:cover;
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.