博客列表 >2020 1211(iframe和css基础)

2020 1211(iframe和css基础)

lus菜
lus菜原创
2020年12月11日 15:39:33613浏览

iframe后台

html样式代码:
  1. <link rel="stylesheet" href="../1210/style/iframe.css" />
  2. <div class="header">网站管理后台</div>
  3. <div class="aside">
  4. <a href="./1208/demo2.html" target="content">链接与锚点</a>
  5. <a href="./1208/demo3.html" target="content">图片</a>
  6. <a href="./1209/demo1.html" target="content">列表元素</a>
  7. <a href="./1209/demo2.html" target="content">表格元素</a>
  8. <a href="./1209/demo8.html" target="content">表单元素</a>
  9. </div>
  10. <div class="main">
  11. <iframe srcdoc="请点击左侧按钮" name="content"></iframe>
  12. </div>
  13. <div class="footer"></div>

css代码:

  1. body {
  2. margin: 0;
  3. display: grid;
  4. grid-template-columns: 10em 1fr;
  5. }
  6. header {
  7. grid-column: span 2;
  8. height: 3em;
  9. background-color: lightblue;
  10. }.aside {
  11. display: grid;
  12. grid-template-rows: repeat(auto-fit, 2em);
  13. background-color: lightcyan;
  14. }
  15. iframe {
  16. width: 100%;
  17. min-height: 22em;
  18. background-color: #fff;
  19. border: none;
  20. padding: 2em;
  21. }
  22. a {
  23. text-decoration: none;
  24. color: #555;
  25. background-color: #fff;
  26. border-bottom: 1px solid #ccc;
  27. border-right: 1px solid #ccc;
  28. }
  29. .footer {
  30. grid-column: span 2;
  31. height: 3em;
  32. background-color: lightblue;
  33. }

CSS优先级:

h1 标签选择器 < * 属性选择器 < 类选择器 例如:.title < id 选择器

!important 会覆盖任何元素声明拥有更大的优先级

  1. h1{
  2. color: yellow;
  3. }
  4. .active{
  5. color: magenta;
  6. }
  7. #first{
  8. color: blue;
  9. }
  10. #page-title{
  11. color: yellow;
  12. }
  13. h1{
  14. color: green !important;
  15. }
声明:本文内容转载自脚本之家,由网友自发贡献,版权归原作者所有,如您发现涉嫌抄袭侵权,请联系admin@php.cn 核实处理。
全部评论
文明上网理性发言,请遵守新闻评论服务协议