day23总结-层叠样式表

css_html

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title></title>
        <style>
            @font-face {
                font-family:myfont;
                src: url("fonts/chunkfive.ttf");
            }
            .ms {
                letter-spacing: 10px;
                font-family: 仿宋;
                color: silver;
                width: 320px;
                height: 60px;
                border: 5px dashed red;
                text-align: center;
                line-height: 60px;
                margin: 10px auto;
                text-decoration: underline;
                text-shadow: 2px -2px blueviolet;
                font-size: 200%;
                font-stretch: condensed;
                font-style: oblique;
                /* font: "仿宋" 200% condensed oblique; */
            }
            .one {
                text-indent: 1.25rem;
            }
            p {
                font-family: "楷体";
                font-size: 30px;
            }
            h3 {
                /* block,inline-block,none,inline(默认值)。值为none时内容不显示且不占空间 */
                display: block;
                font-family: myfont;
                color: #D3D3D3;
                text-transform: uppercase;
            }
            .box {
                border: 4px double green;
                border-left-color: blue;
                border-right-color: red;
                border-radius: 10px 20px 30px 40px;
                width: 50%;   /* 相对于调用时其父级的百分比 */
                margin: 50px auto;
                margin-top: 10px;
                text-align: center;
                background-color: #C0C0C0;
                background-image: url(images/a1.jpg);
                background-repeat: no-repeat no-repeat;
                /* background: url(images/a1.jpg) #C0C0C0 no-repeat no-repeat; */
            }
            #photo {
                border: 20px solid white;
                border-radius: 70px 70px 70px 70px;
                border-image: url(images/icon-plus.png) 10 round;
                opacity: 0.5; 
            }
            #icon {
                width: 100px;
                height: 100px;
                /* background-image: url(images/icons.jpg); */
                /* background-position: -570px -280px; */
                background: url(images/icons.jpg) -570px -280px;
                margin: 20px auto;
            }
            h2 {
                /* visibility: visible;hidden;值为hidden时,内容不显示但仍占页面空间 */
                visibility: hidden;   
            }
            #adv {
                width: 320px;
                height: 135px;
                background-color: #D3D3D3;
                background-image: url(images/www.gif);
                position: fixed;
                right: 5px;
                top: 100px;
                
            }
            /* position属性的取值:static静态定位,默认值;relative相对定位,相对于父级位置;absolute绝对定位,相对于父级位置;fixed固定定位,相对于浏览器位置*/
        </style>
    </head>
    <body background="images/324466.jpg">
        <div id="adv">
            广告
            <button style="float: right">关闭</button>
        </div>
        <div id="icon"></div>
        <h2>goodgoodstudydaydayup</h2>
        <img id="photo" src="images/bird.gif" width="100" height="100">
        <h1 class="ms">静夜思</h1>
        <hr>
        <div class="box">
            <p class="one">床前明月光</p>
            <p>疑是地上霜</p>
            <p>举头望明月</p>
            <p>低头思故乡</p>
        </div>
        <h3>hello world</h3>
    </body>
</html>

form_.html

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>表单</title>
        <style>
            /* 属性选择器 */
            /* 后代选择器 */
            /* form>input 儿子选择器 */
            form input[type=text], form input[type=password] {
                border: none;
                outline: none;
                border-bottom: 1px dashed lightgray;
            }
            /* form+input 相邻兄弟选择器 */
            /* form~input 兄弟选择器 */
            form~input[type=text] {
                outline: none;
                border: 1px solid lightgrey;
            }
            form~input[type=text]:focus {
                outline: none;
                border: 1px solid purple;
            }
            .button {
                display: inline-block;
                width: 80px;
                height: 40px;
                background-color: red;
            }
        </style>
    </head>
    <body background="images/timg.jpg">
        <center>
            <form action="" method="post" enctype="multipart/form-data">
                <fieldset>
                    <legend>用户基本信息</legend>
                    <p>
                        用户名:
                        <input type="text" name="user" maxlength="12" placeholder="6-12位" required>
                    </p>
                    <p>
                        密码:
                        <input type="password" name="pwd">
                    </p>
                    <p>
                        再次确认:
                        <input type="password" name="repwd">
                    </p>
                    <p>
                        性别:
                        <input type="radio" name="sex" value="1" checked>男
                        <input type="radio" name="sex" value="0" readonly>女
                    </p>
                </fieldset>
                <p>
                    爱好:
                    <input type="checkbox" name="babit" value="阅读" checked>阅读
                    <input type="checkbox" name="babit" value="旅游">旅游
                    <input type="checkbox" name="babit" value="游戏">游戏
                    <input type="checkbox" name="babit" value="电影">电影   
                </p>
                <p>
                    头像:
                    <input type="file" multiple>
                </p>
                <p>
                    <select name="prov">
                        <option value="10000">成都</option>
                        <option value="20000">西安</option>
                        <option value="30000">上海</option>
                        <option value="40000" selected>深圳</option>
                    </select>           
                </p>
                <p>
                    生日:
                    <input type="date" name="birt"/>
                </p>
                <p>
                    邮箱:
                    <input type="email" name="email"/>
                </p>
                <p>
                    手机:
                    <input type="tel" name="tel"/>
                </p>
                <p>
                    ===:
                    <input type="image" src="images/a1.jpg"><br>   <!-- 以图片作为提交按钮 -->
                    <input type="hidden" name="aaa" value="bbb">    <!--影藏字段,对用户不显示,用于内部区分,如地区 -->
                </p>
                <p>
                    自我介绍:
                    <textarea rows="10" cols="10" name="intr" placeholder="请输入"></textarea>    <!-- 不能写成<textarea rows="10" cols="10" />  -->
                </p>
                <p>
                    <input class="button" type="submit" value="确定提交" />
                    <input type="reset" value="重置" />
                    <!-- hidden image  -->
                </p>
            </form>
            其他<input type="text" />
        </center>
    </body>
</html>

practice.html

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title></title>
        <style>
            .a {
                width: 400px;
                height: 400px;
                background-color: red;
            }
            .b {
                width: 300px;
                height: 300px;
                background-color: green;
            }
            .c {
                width: 200px;
                height: 200px;
                background-color: blue;
            }
            .b,.c {
                position: relative;
                left: 50px;
                top: 50px;
            }
            .d {
                left: 450px;
                top: 50px;
                background: #FF0000;
                z-index: 100;
            }
            .e {
                left: 550px;
                top: 150px;
                background: #FFFF00;
                z-index: 100;
            }
            .f {
                left: 650px;
                top: 200px;
                background: #0000FF;
                z-index: 30;
                /* z-index值越大,越优先显示在上面 相同的话看调用的先后顺序,在上面abc类中时由于子类覆盖父类,z-index无效*/
            }
            .d,.e,.f {
                position: absolute;
                width: 200px;
                height: 200px;
            }
        </style>
    </head>
    <body>
        <div class="a">
            <div class="b">
                <div class="c"></div>
            </div>
        </div>
        <div class="d"></div>
        <div class="e"></div>
        <div class="f"></div>
    </body>
</html>

table_.html

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title></title>
        <style>
            table {
                /* border-collapse: collapse; */
            }
            td, th {
                border-bottom: 1px solid black;
                border-right: 1px solid black;
                text-align: center;
                empty-cells: hide;
            }
            .bottom>td {
                border-bottom: none;
            }
            .right {
                border-right: none;
            }
            thead>tr {
                background-color: lightgoldenrodyellow;
            }
            .even {
                background-color: lightgrey;
            }
            .odd {
                background-color: lightblue;
            }
            th:first-child {
                border-top-left-radius: 10px;
            }
            th:last-child {
                border-top-right-radius: 10px;
            }
            tr:last-child>td:first-child {
                border-bottom-left-radius: 10px;
            }
            tr:last-child>td:last-child {
                border-bottom-right-radius: 10px;
            }
            .number li {
                /* list-style-type: none; */
                list-style-position: inside;
                list-style-image: url(images/add.gif);
                width: 120px;
                height: 30px;
                background-color: #006633;
                color: white;
                text-align: center;
                margin: 5px 5px;
                /* display: inline; */
                float: left;
                /* 元素的水平方向浮动,意味着元素只能左右移动而不能上下移动。

一个浮动元素会尽量向左或向右移动,直到它的外边缘碰到包含框或另一个浮动框的边框为止。

浮动元素之后的元素将围绕它。

浮动元素之前的元素将不会受到影响。如果你把几个浮动的元素放到一起,如果有空间的话,它们将彼此相邻。 */
            }
            .number li:hover {
                color: orange;
                cursor: pointer;
            }
        </style>
    </head>
    <body>
        <!-- table>tr*4>td*5 -->
        <table>
            <caption>学生考试成绩表</caption>
            <thead>
                <tr>
                    <th class="lt" width="120">姓名</th>
                    <th width="100">语文</th>
                    <th width="100">数学</th>
                    <th width="100">英语</th>
                    <th width="100" class="right">体育</th>
                </tr>
            </thead>
            <tbody>
                <tr class="odd">
                    <td>王大锤</td>
                    <td>90</td>
                    <td>80</td>
                    <td></td>
                    <td class="right">60</td>
                </tr>
                <tr class="even">
                    <td>王大锤</td>
                    <td>90</td>
                    <td></td>
                    <td>70</td>
                    <td class="right">60</td>
                </tr>
                <tr class="bottom odd">
                    <td>王大锤</td>
                    <td>90</td>
                    <td>80</td>
                    <td>70</td>
                    <td class="right">60</td>
                </tr>
            </tbody>
            <tfoot>
            </tfoot>
        </table>
        <ul class="number">
            <li>One</li>
            <li>Two</li>
            <li>Three</li>
            <li>Four</li>
            <li>Five</li>
        </ul>
    </body>
</html>
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 219,427评论 6 508
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 93,551评论 3 395
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 165,747评论 0 356
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 58,939评论 1 295
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 67,955评论 6 392
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 51,737评论 1 305
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 40,448评论 3 420
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 39,352评论 0 276
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 45,834评论 1 317
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 37,992评论 3 338
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 40,133评论 1 351
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 35,815评论 5 346
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 41,477评论 3 331
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 32,022评论 0 22
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 33,147评论 1 272
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 48,398评论 3 373
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 45,077评论 2 355

推荐阅读更多精彩内容

  • 第一部分 HTML&CSS整理答案 1. 什么是HTML5? 答:HTML5是最新的HTML标准。 注意:讲述HT...
    kismetajun阅读 27,489评论 1 45
  • 问答题47 /72 常见浏览器兼容性问题与解决方案? 参考答案 (1)浏览器兼容问题一:不同浏览器的标签默认的外补...
    _Yfling阅读 13,754评论 1 92
  • CSS全称为“层叠样式表 (Cascading Style Sheets)”,它主要是用于定义HTML内容在浏览器...
    百作不死的学习阅读 1,165评论 0 7
  • 罔谈彼短:罔,从网从亡,本意为捕鱼的网,现代汉语禁止之意。谈,从言从炎,炎是淡的本字,平淡交流。彼,左边表示前行,...
    李炜微言阅读 709评论 0 1
  • 今年春节,朋友圈全是晒出门各种旅游的动态。而我,在家听故事! 人生呀,无处不精彩,故事情节雷同,纯属故事真实发生在...
    李文欣_e7ef阅读 522评论 0 1