Blogger Information
Blog 16
fans 0
comment 1
visits 5793
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
后台布局与html元素的样式来源与优先级
P粉890456325
Original
341 people have browsed it

0117作业

作业内容:

1. 用<iframe>写一个简单的后台布局, 注意a.target与iframe.name的配合




  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <title>Document</title>
  8. <link rel="stylesheet" href="static/css/admin.css">
  9. </head>
  10. <body>
  11. <!-- 顶部 logo 状态 -->
  12. <header>
  13. <h1>网站后台管理系统<small>(v1.0)</small></h1>
  14. <section>
  15. <em>admin</em>
  16. <button onclick="logout()">退出</button>
  17. </section>
  18. </header>
  19. <!-- 左侧 链接 操作入口 a:target="content"和 iframe:name="content" 必须一致,才能实现显示在主体页面上-->
  20. <nav>
  21. <a href="../0117/demo1.html" target="content">课程表</a>
  22. <a href="../0117/dome2.html" target="content">用户登录</a>
  23. <a href="../0117/dome3.html" target="content">用户注册</a>
  24. </nav>
  25. <!-- 主体 变化的是主体 src="inc/default.html"和srcdoc="<p style='color:red'>请点击城市名称</p>"区别是链接和代码-->
  26. <iframe src="inc/default.html" frameborder="0" name="content"></iframe>
  27. <script>
  28. function logout() {
  29. return confirm('是否退出?') ? alert('退出成功') : false
  30. }
  31. </script>
  32. </body>
  33. </html>

2. 实例演示html元素的样式来源与优先级(要有图示)

  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <title>Document</title>
  8. <!-- 引用外部css样式文件 -->
  9. <link rel="stylesheet" href="static/css/style.css">
  10. </head>
  11. <body>
  12. <style>
  13. /* 指令添加外部css文件 */
  14. /* @import url('static/css/style.css'); */
  15. h1{
  16. color: blueviolet;
  17. }
  18. /*
  19. 行内样式高于》文档样式高于》外部样式
  20. 需要自定义元素 选择器 指定样式规则
  21. 文档样式规则如下
  22. h1选择器
  23. 样式声明如下
  24. {
  25. color: blueviolet;
  26. font-weight: normal;
  27. }
  28. */
  29. </style>
  30. <h1 style="color: red;">hello</h1>
  31. </body>
  32. </html>
Correcting teacher:PHPzPHPz

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