博客列表 >内联框架和CSS

内联框架和CSS

华宥为
华宥为原创
2020年12月10日 21:49:45761浏览

内联框架

iframe

  1. <a href="" target="hefei">合肥市地图</a>
  2. <iframe src="https://" name="hefei"></iframe>
  3. <iframe srcdoc="合肥市" name="hefei"></iframe>

网站后台制作(mini)

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  6. <title>迷你小后台</title>
  7. </head>
  8. <body>
  9. <div class="header">网络管理后台</div>
  10. <div class="aside">
  11. <a href="domo1.html" target="countent">链接与锚点</a>
  12. <a href="domo1.html" target="countent">链接与锚点</a>
  13. <a href="domo1.html" target="countent">链接与锚点</a>
  14. <a href="domo1.html" target="countent">链接与锚点</a>
  15. </div>
  16. <div class="main">
  17. <iframe srcdoc="请...." name="countent"></iframe>
  18. </div>

布局元素

  • 页眉 <header></header>
    <div class="container">

  • 侧边栏 <aside></aside>

  • 主体

  1. <main>
  2. <div>
  3. <section>
  4. <h1>lalala</h1>
  5. </section>
  6. <section>
  7. <h1>lalala</h1>
  8. </section>
  9. </div>
  10. </main>
  • 页脚 <footer></footer>

&lt &gt 实体字符 页面中原样显示不会被浏览器解析

<div></div>: 标签:通用容器标签,内部可以放置任何类型元素,当 一个容器类型不定时可以用它
<span></span>:通用容器,内部是行内元素/文本/图片/链接/input


css 的学习

语法和基本术语

<header class="page-header">
<h1 id="page-tetle" class="title" style="color:blue"></h1>
如果您的 css 样式仅仅用来控制当前页面元素,就用 style 标签写入

  1. <style>
  2. 术语:规则 选择器,声明块,属性和值
  3. 选择器:h1
  4. 声明块:由一对{...}包住的内容
  5. 规则:选择器+声明块
  6. 属性和值:写在声明块中的名值对
  7. h1{
  8. <!-- 样式声明 -->
  9. colorgreen;
  10. font-weight:200;
  11. }
  12. </style>

一个元素的样式来源受四个级别影响:
1.inherited from html 继承于 html,根据元素在文档的结构和层级
2.user agent stylesheet 用户代理样式表 ,代理发出用户的网络请求,默认浏览器
3.demo1.html 用户自定义样式写到<style></style>标签中
4.elenent.style 行内样式,仅适用于当前元素,对其他元素无影响。写到 style 属性

层叠与优先级

1.标签选择器

  1. h1{
  2. colot:green;
  3. }

2.属性选择器
*:表示所有元素/标签

  1. *[class="title"]{
  2. color:red;
  3. }
  4. h2[class="title"]{
  5. color:red;
  6. }

不建议用 ID 选择器

3.类选择器
class 简写 .

  1. .title{
  2. color:red;
  3. }

4.id 选择器
ID 简写#

  1. #page-title{
  2. color:red;
  3. }

优先级 id->类->标签选择器
!important;(提高优先级)

声明:本文内容转载自脚本之家,由网友自发贡献,版权归原作者所有,如您发现涉嫌抄袭侵权,请联系admin@php.cn 核实处理。
全部评论
文明上网理性发言,请遵守新闻评论服务协议