css 样式表 含左浮动 右浮动

                 

 

 ****** 链接外部样式
  css
  h1{
          color: aquamarine;
          font-size: 120;
          font-weight: 150;
          font-style: italic;
}

外部html 注释  rel很重要

<!DOCTYPE html>
<html>
       <head>
                <meta charset="UTF-8">
              <title></title>
       </head>
      <body>
                     <link  href="css/waibu.css"  type="text/css" rel="stylesheet"/> 
                    <h1>我的天啊</h1>
    </body>
</html>

******导入样式
注释:style 写在head 里面

<!DOCTYPE html>
   <html>
       <head>
               <meta charset="UTF-8">
                  <title></title>

                   <style type="text/css">
                        @import url("css/waibu.css");
              </style>
      </head>
      <body>
                     <h1>哦豁</h1>
     </body>
</html>

******行内样式

<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title></title>
    </head>
    <body>
        <p style="font-size: 60; color: cornflowerblue; font-style: italic;">我是谁</p>
    </body>
</html>

*****内嵌样式

<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title></title>
        <style type="text/css">
            h1{
                font-size: 100px;
                color: deepskyblue;
                font-weight:  200;
                font-style: italic;
            }
        </style>
    </head>
    
    <body>
         <h1>woshishei </h1>
    </body>
</html>

 

                   list-style-type      定义列表前面的项目符号
                  Disc(实心圆)、circle(空心圆)、  square(方块)、   none(不使用任何标号)。
                  list-style-image     定义列表项标志的图像【设置了图片上面的不好用了最好上个属性设置成none】
                  语法格式如下:list-style-image:none|url(url)
                   list-style-position   列表位置
                语法格式如下:list-style-position:outside(默认)|inside()在列表li的里面还是外面
                 去掉列表案例符号的代码是:  ul{list-style:none;}
                 <style type="text/css">
             ul{
                 border: 1px solid red;
             }
            ul li{
                border: 1px dashed black;
                /*list-style-type: decimal;   数字 变成了有序列表
                list-style-image: url(../img/logo1.jpg);
                list-style-position: outside; 设置在li的里面还是外面*/ 
                list-style: url(../img/logo1.jpg) inside;
            }
        </style>
<ul>
            <li>列表</li>
            <li>列表2</li>
            <li>列表3</li>
</ul>


各种样式  可用copy试试


<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title></title>
        <style>
            p{
                color:red;
                font-size: 50px;
                /*font-family: "微软雅黑";*/
                font-weight:bold;
                font-style: italic;
                text-decoration: underline;
                text-align: center;
                text-indent: 4;
                line-height: 25px;
                text-shadow: 10px -10px 5px aqua;
                
                border-style: dashed;/*边框的虚线  实心 solid*/
                border-top-style: solid;
                
                border: 1px solid orangered;
                height: 400px;
                width: 400px;
                border-radius: 100px;
                box-shadow: 12px 12px 12px orangered;/*盒子的阴影*/
                
                /*background:  url(img/同学淡定.jpg) no-repeat right top;*/
                background-color: antiquewhite;
                background-image: url(img/同学淡定.jpg);
                background-repeat: repeat;
                
                 Background-position:center;         
                 Background-position:50% 50%;          
                 Background-position:50% center;       
                 Background-position:center 50%;
                /*可以取的值为关键字,数值,百分比  
                                               平:left  center right(或者数值)
                                                 垂直:top   center  bottom(或者数值)
                 */
            }
        </style>
    </head>
    <body>
        
        <p>我是谁</p>
    </body>
</html>

 

分块展示

<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title></title>
        <style>
            p{
                background-color: cornflowerblue;
                height: 90px;
                
            }
            div{
                margin-top: 1px;
                background-color: yellow;
                height: 50px;
            }
            div.a{
                display: block;
                background-color: lawngreen;
                height: 270px;
            }
            h1{
                background-color: darkgoldenrod;
                height: 202px;
                margin-top:17px;
                width: 25%;
                float:left;
            }
            
            div.di{
                margin-top: 230px;
                height: 200px;
                
                background-color:black;
                
            }
            h3{
                height: 200px;
                width: 73.5%;
                background-color: firebrick;
                float: right;
            }
            
        </style>
    </head>
    <body>
        <p>one</p>
        <div>two</div>
        <div class="a">42</div>
        <h1>嘿</h1>
        
        <h3>w</h3>
        <div class="di">22</div>
    </body>
</html>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值