搜索
博主信息
博文 14
粉丝 0
评论 0
访问量 12302
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
css基础20190903作业
德性的博客
原创
894人浏览过

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

实例

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

<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>
</head>

<body>
    <h1>内联框架的演示</h1>
    <h3>
        <a href="https://baidu.com" target="baidu">百度</a>
    </h3>
    <p>
        <iframe frameborder="1" name="baidu" width="500" height="500"></iframe>
    </p>
</body>

</html>

运行实例 »

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

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

实例

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

<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样式设置优先级</title>
    <link rel="stylesheet" href="demo02b.css">
    <style>
        p {
            color: green;
        }
    </style>
</head>

<body>
    <!-- 内联样式>内部样式>外部样式 -->
    <p>测试样式表优先级</p>
    <p>测试样式表优先级</p>
    <p style="color: blue">测试样式表优先级</p>
</body>

</html>

运行实例 »

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

实例

/* demo02b.css */
p {
    color: red;
}

运行实例 »

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


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

实例

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

<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>
/* id选择器 */
#test01 {
color: red;
}
/* class选择器 */
.test02 {
color: green;
}
/* 标签选择器 */
p {
color: blue;
}
</style>
</head>

<body>
<!-- id定位到单个元素,class定位于存在相同class名称的元素 -->
<!-- 优先级:标签<class<id<js -->
<p id="test01">用id的元素</p>
<p class="test02" id="test01">Class名称为test02的元素</p>
<p class="test02">Class名称为test02的元素</p>
<p class="test02">Class名称为test02的元素</p>
</body>

</html>

运行实例 »

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

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

实例

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

<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盒模型</title>
    <link rel="stylesheet" href="demo02d.css">
</head>

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

</html>

运行实例 »

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

实例

/* demo02d.css */

.box1 {
    width: 200px;
    height: 200px;
    background-color: green;
    padding: 20px 30px 40px 50px;
    border-top: 10px solid red;
    border-right: 15px dashed blue;
    border-bottom: 10px dotted lightcoral;
    border-left: 20px double black;
}

.box2 {
    /* width: inherit; */
    height: inherit;
    background-color: wheat;
}

运行实例 »

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

批改状态:合格

老师批语:iframe主要用来写后台页面, 因为有这个标签的页面, 基本上难以被搜索引擎收录
本博文版权归博主所有,转载请注明地址!如有侵权、违法,请联系admin@php.cn举报处理!
全部评论 文明上网理性发言,请遵守新闻评论服务协议
0条评论
作者最新博文
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习
PHP中文网抖音号
发现有趣的

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号

  • 登录PHP中文网,和优秀的人一起学习!
    全站2000+教程免费学