zoukankan      html  css  js  c++  java
  • CSS 边框属性和背景属性的初步了解

    边框属性和背景属性

    边框(border)属性

    border 属性

    border属性是设置对象边框的特性。

    举例1:为段落标签添加一个边框,颜色为红色,边框线为实线,实线大小为5个像素点

    Google 浏览器中打开,查看效果:

    举例2:

    Google 浏览器中打开,查看效果:

    背景属性

    background 属性

    background属性设置对象的背景特性。

    举例:

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>背景(background)属性</title>
        <!--
        定义body元素的背景颜色为宝蓝色,
        背景传入笑脸图片('smiley.gif'),笑脸图片不能重复(no-repeat),且要在页面居中(fixed center)
        -->
        <style>
            body
            {
                background: royalblue url('smiley.gif') no-repeat fixed center;
            }
        </style>
    </head>
    
    <body>
    <p>This is some text</p>
    <p>This is some text</p>
    <p>This is some text</p>
    <p>This is some text</p>
    <p>This is some text</p>
    <p>This is some text</p>
    <p>This is some text</p>
    <p>This is some text</p>
    <p>This is some text</p>
    <p>This is some text</p>
    <p>This is some text</p>
    <p>This is some text</p>
    </body>
    
    </html>

    Google 浏览器中打开,查看效果:

               

  • 相关阅读:
    zzulioj--1716--毒(模拟水题)
    zzulioj--1715--土豪银行(贪心)
    35.Java中mian方法详解
    34.Java内存布局以及java各种存储区【详解】
    33.Java中static关键字
    32.java的this关键字
    31.Java构造方法
    30.Java对象的特证之一-封装
    29.Java匿名对象
    28.Java局部变量和成员变量
  • 原文地址:https://www.cnblogs.com/liyihua/p/12369138.html
Copyright © 2011-2022 走看看