背景附件:固定和位置:固定之间的区别

  • 本文关键字:之间 区别 位置 背景 css
  • 更新时间 :
  • 英文 :


我是 CSS 的初学者,我对这个 2 ...谁能解释我背景附件:固定和位置:固定???有什么区别

<!DOCTYPE html>
<html>
<head>
<style>
body  {
background-image: url('w3css.gif');
background-repeat: no-repeat;
background-attachment: fixed;
}
p{
position: fixed;
color:Red;
}
</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>
<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>If you do not see any scrollbars, try to resize the browser window.</p>
</body>
</html>

背景附件:固定用于定位图像,其中 as , 位置 :fixed; 用于 p ,span ,div 等元素。

最新更新