day15 html、js

來源:互聯網
上載者:User

標籤:

HTML

加減框代碼:

<!DOCTYPE html><html lang="en"><head>    <meta charset="UTF-8">    <title></title>    <style>        .inp{            border: 0;            border-left: 1px solid #dddddd;            border-right: 1px solid #dddddd;            height: 25px;            margin: 0;            padding: 0;            float: left;        }        .sp{            display: inline-block;            height: 25px;            width: 25px;            text-align: center;            line-height: 25px;            float: left;        }    </style></head><body>    <div style="border: 1px solid #dddddd;display: inline-block;">        <div class="sp">-</div>        <input class="inp" type="text" />        <div class="sp">+</div>    </div></body></html>

針對無法載入的圖片提示:

<!DOCTYPE html><html lang="en"><head>    <meta charset="UTF-8">    <title></title>    <style>        img{            border: 0;        }    </style></head><body>    <div>        <div class="item">            <a href="http://www.etiantian.org">                <img src="2.jp" alt="圖片">            </a>        </div>    </div></body></html>

css樣式優先順序應用:

<!DOCTYPE html><html lang="en"><head>    <meta charset="UTF-8">    <title></title>    <style>        .hide{            display: none !important;        }        .c1{            color: red !important;        }        .c2{            color: green;        }    </style></head><body>    <div class="c1 c2">asdfasdfasdfasdf</div></body></html>

css標籤選取器

<!DOCTYPE html><html lang="en"><head>    <meta charset="UTF-8">    <title></title>    <style>        .c1[alex=‘a‘]{            color: red;        }    </style></head><body>    <div>        <div class="c1" alex="a">1</div>        <div class="c1" alex="b">2</div>        <div class="c1">3</div>        <div class="c1" alex="a">4</div>    </div></body></html>

使用者登入邊框:

<!DOCTYPE html><html lang="en"><head>    <meta charset="UTF-8">    <title></title>    <style>        .icon-name{            background-image: url(‘i_name.jpg‘);            height: 16px;            width: 16px;            display: inline-block;        }        .icon-pwd{            background-image: url(‘i_pwd.jpg‘);            height: 16px;            width: 16px;            display: inline-block;        }    </style></head><body>    <div style="width: 200px;position: relative">        <input style="width: 180px;padding-right: 20px;" />        <span class="icon-name" style="position: absolute;top:2px;right: 0;"></span>    </div></body></html>

通過內部邊距撐外邊框:

<!DOCTYPE html><html lang="en"><head>    <meta charset="UTF-8">    <title></title>    <style>        .c1:hover{            background-color: #2459a2;        }        .c2:before{            content: ‘666‘;        }        .c2:after {            content: ‘777‘;        }        .left{            float: left;        }        .item{            background-color: red;        }        .clearfix:after{            content: ‘.‘;            clear: both;            display: block;            visibility: hidden;            height: 0;        }    </style></head><body>    <div class="c1">ddd</div>    <div class="c2">888</div>    <div style="background-color: red" class="clearfix">        <div class="left" style="height: 100px;background-color: green">1</div>        <div class="left">2</div>    </div></body></html>

顯示三角

<!DOCTYPE html><html lang="en"><head>    <meta charset="UTF-8">    <title></title>    <style>        .icon{            display: inline-block;            border-top: 15px solid transparent;            border-right: 15px solid red;            border-bottom: 15px solid transparent;            border-left: 15px solid transparent;        }    </style></head><body>    <div class="icon"></div></body></html>

  

 

day15 html、js

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.