1  背景相关

  背景颜色      background-color         =  颜色名称/rgb值/十六进制值

  背景图片      background-image      =  url('')

  背景图片平铺方式  background-repeat       =  repeat-x(仅水平平铺)  repeat-y(仅垂直平铺)  no-repeat(不平铺)

  设置背景图片位置  background-position     =  数字+单位/center/top/bottom/left/right   同上。  例如:50px 50px

  背景图片是否滚动  background-attachment    =  fixed(不滚动)   scroll(滚动)

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>first page</title>
    <style>

        body{
            background-color: aliceblue;
            background-image: url('l.jpg');
            background-repeat: no-repeat;
            background-position: right top;
            background-attachment: fixed;
        }


    </style>
</head>
<body>
<h1 >hello world</h1>
<p >this paragra is only used for test</p>

<br>
<p>hello world</p>
<p>hello world</p><p>hello world</p><p>hello world</p><p>hello world</p><p>hello world</p>
<p>hello world</p><p>hello world</p><p>hello world</p><p>hello world</p><p>hello world</p>
<p>hello world</p><p>hello world</p><p>hello world</p><p>hello world</p><p>hello world</p>
<p>hello world</p><p>hello world</p><p>hello world</p><p>hello world</p><p>hello world</p>
<p>hello world</p><p>hello world</p><p>hello world</p><p>hello world</p>

</body>
</html>
View Code

相关文章:

猜你喜欢
  • 2021-12-03
  • 2021-09-15
  • 2021-06-20
  • 2021-06-20
  • 2021-05-25
  • 2021-12-13
  • 2022-02-27
相关资源
相似解决方案