zoukankan      html  css  js  c++  java
  • Css 分类 属性 选择器

    Css 层叠样式表 美化页面的小工具

    分类:

      内联 (行内)在标签内部以属性的形式呈现,属性名style

           内嵌 head标签内以标签形式呈现,标签名style

           外部 head标签内 加link标签 引入外部文件 *.css

    <link rel="stylesheet" type="text/css" href="file:///D|/SSs/作业/3.12/图标.css" />
    link标签

      插入icon图标(加icon图标,路径必须绝对路径)

    <link rel="shortcut icon" href="xxx.ico" type="image/x-icon"/>
    icon图标

    选择器:

      用来找元素,将样式用在标签上。

        标签选择器 .div{}

        id选择器 #id{}

        class选择器.class{}

        并列(加逗号)选择器1,选择器2

        父子(加空格)父选择器  子选择器

           *{}全页面

    属性:

      文本:

        text-decoration 文本修饰  (下划线什么的)

        text-indent   缩进

        text-shadow 阴影 1px(水平阴影的位置)1px(垂直) 1px(模糊的距离) # (阴影颜色)

        font-weight字体加粗

        em表一个字大小

      背景:

        background-position: 属性 定义div内图片在div的位置  可以写两个值左右上下

    <head>
        <style>        
            #div{ 
            width:100%;
            height:111px;
            background-image:url();
                background-position:34% 0
            }
        </style>
    </head>
    
    <body>
        <div id="div"></div>
    </body>        
    bg-position

        

        background-size            图片大小 等比缩放

        background:颜色 图片 平铺 位置 大小

    总结问题:

      1.text-indent 缩进属性,只能用在块标签上,span之类的行标签不能用

        解决办法:给span加display:inline-block;属性,变为行内块标签。

      2.大div套小div,若父div不设宽高,则他会随着子div的位置移动而改变。

        如margin float属性,写在子div,父div也会移动。

        解决办法:给父div设置边框或定义宽高。

      3.改变<hr/>的颜色

      <hr style="background-color:#ECECEC; border:none; height:1px;" />

      取消边框,设背景色 设高。

  • 相关阅读:
    圖標網址
    webmethod Ajax请求格式和返回类型 汇总
    第一阶段图标动效打卡
    大数据可视化--控件设计
    Python 多任务(进程) day1(3)
    Python 多任务(进程) day1(2)
    Python 多任务(进程) day1(1)
    Python 多任务(线程) day2 (2)
    Python 多任务(线程) day1
    TCP和UDP的一些注意事项
  • 原文地址:https://www.cnblogs.com/SSs1995/p/8552545.html
Copyright © 2011-2022 走看看