zoukankan      html  css  js  c++  java
  • CSS---h3标题、横线、和圆形按纽共处一行

    代码如下:

    <html>
    <head>
        <meta charset="utf-8">
        <title></title>
        <style type="text/css">
            *{
                padding: 0;
                margin:0;
            }
            .clearfloat{
                zoom:1;/*激活IE属性*/
            }
            .clearfloat:after{
                display: block;
                clear: both;
                content: '';
                visibility: hidden;
                height: 0;
            }
            .header{
                width: 1000px;
                height: 40px;
                line-height: 40px;
                margin: 0 auto;
                background: #ccc;
            }
            .header h3{
                float: left;
                margin-left: 40px;
                color: #fff;
            }
            .header .line{
                float: left;
                width: 200px;
                margin-left: 50px;
                margin-top: 20px;
                border-top: 1px solid #fff;
            }
            .header .btn-group{
                float: right;
                margin-right: 20px;
            }
            .header .btn{
                /*inline-block元素默认会有4px的边距的hack,例如img,解决方法是将其改成block元素*/
                display: inline-block;
                width: 10px;
                height: 10px;
                margin-left: 6px;
                background: #999;
                border-radius: 50%;/*盒子会变成圆*/
            }
            .header .active{
                background: #69f;
            }
        </style>
    </head>
    <body>
        <div class="header clearfloat">
            <h3>fruit list</h3>
            <div class="line"></div>
            <div class="btn-group">
                <a href="" class="btn active"></a>
                <a href="" class="btn"></a>
                <a href="" class="btn"></a>
                <a href="" class="btn"></a>
            </div>
        </div>
    </body>
    </html>
  • 相关阅读:
    491 · 回文数
    936 · 首字母大写
    1343 · 两字符串和
    1535 · 转换成小写字母
    13 · 字符串查找
    146 · 大小写转换 II
    241 · 转换字符串到整数(容易版)
    46 · 主元素
    kotlin协程——>通道
    kotlin协程——>异步流
  • 原文地址:https://www.cnblogs.com/beast-king/p/5572838.html
Copyright © 2011-2022 走看看