CSS

通过3种方法在html中显示:

1.内部嵌入式   <标签 样式属性名:样式属性值;样式属性名:样式属性值;>

<html>

  <head><meta></head>

  <body>

    <div  style:"width:500px;hegth:300px;backgroud-color:#c4c4c4;backgroud-image:url('images/luzhishen.png');backgroud-repeat:no-repeat;">

    <div  style:"width:500px;hegth:300px;backgroud:#c4c4c4  url('images/luzhishen.png'  no-repeat;">

  </body>

<html>

  

 

2.定义内部潜入块对象

<html>

  <head>

    <!--id选择器-->

    #myClass1{

        

                width:500px;

      heghit:300px;

      backgroud-color:#c4c4c4;

      backgroud-image:url('images/luzhishen.png');

      backgroud-repeat:no-repeat;

        

    }

    <!--标签选择器-->

    span{

        font-size:50px;

        color:red;

    }

  <!--类选择器-->

  .myClass{

    color:green;

  }

  </head>

  <body>

    <div  id="myClass1"></div>

    <span>用户名不能为空</span>

    <a  class="">

    <ul>

      <li>...

  </body>

</html>

3.嵌入外部样式文件

<html>

  <head>

      <link type=""  ref=”“ href="">

  </head>

<body><div id=""></div>></body>

 

 

-----------------------------------------

设置边框颜色宽度样式

<style type="css/text">  

 #myClass{   border:1px solid red;  }  

</style>

<div id="myClass"></div>

 设置鼠标移动效果

span:hover

{

   backgroud-color:yellow;

}

 设置隐藏与显示

div{

 display:none;  display:block;

}

 设置字体大小

<style>  

div{   

   font-size:15px;  

 }

</style>

设置文本装饰

<style>  

a{   text-decoration:none;underline     }

</style>

设置列表样式:

ul{

  list-style-type:none;

其中还有crcle square upper-roman

}

 

posted @ 2018-02-01 18:01  超重语言  阅读(124)  评论(0编辑  收藏  举报