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

    }

  • 相关阅读:
    C++ 顺序表实现
    C++ 第三十四天
    C++ 第三十三天
    机器学习相关- 学习资料收集
    【Debian 8.8】Java 8 安装以及环境变量配置
    算法导论(第三版)练习 1.2-1 ~ 1.1-3
    条款33: 明智地使用内联
    条款32: 尽可能地推迟变量的定义
    条款31: 千万不要返回局部对象的引用,也不要返回函数内部用new初始化的指针的引用
    【Nginx】进程模型
  • 原文地址:https://www.cnblogs.com/sunyuhuan/p/8400370.html
Copyright © 2011-2022 走看看