zoukankan      html  css  js  c++  java
  • CSS

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

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

    <html>

      <head><meta></head>

      <body>

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

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

      </body>

    <html>

      

    2.定义内部潜入块对象

    <html>

      <head>

        <!--id选择器-->

        #myClass1{

            

                    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

    }

  • 相关阅读:
    MarkDown
    【ImageView】ImageView点击事件报错空指针
    【原创】初识懒人开发库---ButterKnife
    将博客搬至CSDN
    【练习】内容提供器二、创建自己的内容提供器并测试
    【练习】内容提供器一、访问其他程序的数据
    【转载】Android数据存储之SQLite
    【实战】广播实践,实现登录强制下线
    【实战】聊天窗口的实现
    【转载】Adapter用法总结大全
  • 原文地址:https://www.cnblogs.com/sunyuhuan/p/8400370.html
Copyright © 2011-2022 走看看