在CSS中使用background-attachment属性
的背景依恋t特性用于控制在背景图像的滚动。
示例
您可以尝试运行以下代码,以了解如何使用background-attachment属性:
<!DOCTYPE html>
<html>
<head>
<style>
body {
background-image: url('/css/images/css.jpg');
background-repeat: no-repeat;
background-attachment: fixed;
}
</style>
</head>
<body>
<p>The background-image is fixed. Try to scroll down the page.</p>
<p>The background-image is fixed. Try to scroll down the page.</p>
<p>The background-image is fixed. Try to scroll down the page.</p>
<p>The background-image is fixed. Try to scroll down the page.</p>
<p>The background-image is fixed. Try to scroll down the page.</p>
<p>The background-image is fixed. Try to scroll down the page.</p>
<p>The background-image is fixed. Try to scroll down the page.</p>
<p>The background-image is fixed. Try to scroll down the page.</p>
<p>The background-image is fixed. Try to scroll down the page.</p>
</body>
</html>热门推荐
10 网友婚姻祝福语大全简短
11 请灵回向祝福语简短
12 生日祝福语古朴简短独特
13 企业励志拜年祝福语简短
14 学生祝福语简短古诗句
15 冬季祝福语大全 简短的
16 生日祝福语简短激励女生
17 七一祝福语明信片文案简短
18 友谊诗歌祝福语大全简短