CSS .和#的区别

    xiaoxiao2025-02-18  12

     "." 是表示class中的中的属性  

    "#" 是用于id

    如果是标签的话直接打标签名

    演示如下:

    /* css中对class的使用 */ .rg_left{ /*border: 1px solid red;*/ float: left; margin: 15px; } /* css中对id的使用 */ #btn_sub{ width: 100px; height: 40px; background-color: #FFD026; border: 1px solid #FFD026; } /* css对标签的使用方法 */ body { margin: 100px; background: url("./image/bear.png") center; }

     

    最新回复(0)