2020/5/18 JAVA CSS 2

1.title主题中显示小图片:

  在head中添加<link rel="shortcut icon" href="img/a.ico">

2.超链接事件:

  未访问时的样式:a: link{

             color: red;

             text-decoration: none;

          }

  鼠标点击后的样式 :a:visited{

              color :green;
            }

  鼠标放上去的时候的样式:a:hover{

                color:pinke;

               }
  鼠标点击时的样子:a:active{

              color:yellow;

             }
除hover外其他三个事件只能在a标签中使用

3.当鼠标放上去时的样子(鼠标变小手)

  div:hover{

    cursor:pointer;

    }

4.背景样式

  background-color:背景颜色

  横向平铺:background-repeat: repeat-x;  

      纵向平铺:background-repeat: repeat-y;

   固定背景图随着滚轮滚动:background- attachment:fixed;

   插入背景图片:background-image:url();

   调背景图片的位置(x轴向右移为+,y轴向下移为+):background-position:-100px -100px;  

5. 浮动布局

  左浮动:float:left

  右浮动:float:right

  取消全部浮动:clear:both

  外边距:margin:

  顺序上右下左:margin:5px 10px 30px 20px;

  

原文地址:https://www.cnblogs.com/luzhijin/p/12911193.html