Blogger Information
Blog 13
fans 0
comment 0
visits 5455
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
第三节课html标签元素属性作业-2019-8-30 作
鹰弘网络科技的博客
Original
631 people have browsed it

1、实例演示:<iframe>标签的使用

实例

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>iframe作业</title>
    <style>
        iframe {
            width: 500px;
            height: 600px;
            border: solid 1px #ccc;
            float: left;
        }
        
        ul {
            float: left;
        }
    </style>
</head>

<body>
    <ul>
        <li><a href="demo1.html" target="demo">我是demo1</a></li>
        <li><a href="demo2.html" target="demo">我是demo2</a></li>
        <li><a href="demo3.html" target="demo">我是demo3</a></li>
    </ul>
    <iframe srcdoc="我会显示3个demo内容" frameborder="0" name="demo"></iframe>

</body>

</html>

运行实例 »

点击 "运行实例" 按钮查看在线实例

2、实例演示: css样式设置的优先级

实例

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="static/css/style3.css">
    <title>CSS优先级作业</title>
    <style>
        p {
            color: blue
        }
    </style>
</head>

<body>
    <p style="color:red;">我是最大的内联样式表</p>
    <p>我是老二内部样式表</p>
    <p>我是老三外部样式表</p>

</body>

</html>

运行实例 »

点击 "运行实例" 按钮查看在线实例

附加外部的css内容是

p {
    color: green;
}

 3、实例演示: css的id, class与标签选择器的使用规则

实例

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>CSS的id,class,标签选择器作业</title>
    <style>
        .tq {
            color: lightblue;
        }
        
        #tq {
            color: pink;
        }
        
        span {
            font-size: 22px;
            font-weight: bold;
        }
    </style>
</head>

<body>
    <span class="tq">今天天气不太好</span><br>
    <span id="tq">今天天气不太好</span><br>
    <span>今天天气不太好</span>
</body>

</html>

运行实例 »

点击 "运行实例" 按钮查看在线实例

4、实例演示盒模型的五大要素: width, height, padding, border, margin(margin可暂忽略)

实例

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>盒模型作业</title>
    <style>
        .box {
            width: 500px;
            height: 500px;
            border: 1px solid blue;
            margin: 100px auto;
        }
        
        .box1 {
            width: 300px;
            height: 300px;
            border: 1px solid green;
            padding: 30px 20px 15px 50px;
        }
    </style>
</head>

<body>
    <div class="box">
        <div class="box1"></div>
    </div>
</body>

</html>

运行实例 »

点击 "运行实例" 按钮查看在线实例

Correction status:qualified

Teacher's comments:关于盒模式, 案例正确
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post