html基本结构分析

html基本结构分析

HTML称为超文本标记语言,是一种标记语言。它包括一系列标签.通过这些标签可以将网络上的文档格式统一,使分散的Internet资源连接为一个逻辑整体。HTML文本是由HTML命令组成的描述性文本,HTML命令可以说明文字,图形、动画、声音、表格、链接等。

一个完整的HTML文档必须包含3个部分:文档声明、文档头部和文档主体。而正是它们构成了HTML的骨架结构。前面已经分别介绍过文档声明和文档头部,本文将详细介绍构成HTML骨架结构的基础元素

HTML

<html>元素代表HTML文档的根(root),其他所有元素都是该元素的后代。<html>与html>标签限定了文档的开始点和结束点,在它们之间是文档的头部和主体。文档的头部由标签定义,而主体由标签定义

ef9735db0fa6b5197ac9f611f3f1ea3.png

【xmlns】

xmlns属性用于指派文档的XML命名空间。预设值是"http://www.w3.org/1999/xhtml",这在XHTML中是必要的,而在HTML中则是可选的

<html xmlns="http://www.w3.org/1999/xhtml">

HEAD

标签用于定义文档的头部,它是所有头部元素的容器。;大部分不可见,描述了文档的一些基本的属性和信息(可以呈现的是title和icon)。元素下的子元素主要包括、<base>、<link>、<style>和<script>这六个元素</p><p><title>定义文档的标题,它是head部分中唯一必需的元素</p><p>如果在文档中忽略了<head>标签,则大部分浏览器会自动创建一个<head>元素</p><p>关于文档头部的更多信息移步至此</p><p>BODY</p><p><body>表示的是<a href="/tag-news-name-HTML-p-1.html">HTML</a>文档的主体内容,任何一个<a href="/tag-news-name-HTML-p-1.html">HTML</a>文档,只允许存在一个<body>元素</p><p>【默认样式】</p><pre>chrome/firefox/safari/IE8+ margin:8px; IE7- margin:15px 10px;</pre><p>结构</p><p>在sublime编辑器中,输入!,再按住Tab键,就可以生成一个基本的<a href="/tag-news-name-HTML-p-1.html">HTML</a>结构,结构如下</p><pre><!DOCTYPE <a href="/tag-news-name-html-p-1.html">html</a>> <<a href="/tag-news-name-html-p-1.html">html</a>> <head> <meta charset="UTF-8"> <title>Document</title> </head> <body></body> </<a href="/tag-news-name-html-p-1.html">html</a>></pre><p>在实际中,文档的头部结构常常需要承载一些常用的功能,所以<a href="/tag-news-name-HTML-p-1.html">HTML</a>结构较复杂,结构如下</p><pre><!DOCTYPE <a href="/tag-news-name-html-p-1.html">html</a>> <<a href="/tag-news-name-html-p-1.html">html</a>> <head> <meta charset="utf-8"/> <title>Document</title> <meta name="keywords" content=""/> <meta name="description" content=""/> <meta name="viewport" content="width=device-width"/> <link rel="stylesheet" href="5/style.css"/> <link rel="shortcut icon" href="ico.ico"/> </head> <body></body> </<a href="/tag-news-name-html-p-1.html">html</a>></pre><p>相关推荐:<a href="/tag-news-name-html-p-1.html">html</a>教程<br/></p><p>以上就是<a href="/tag-news-name-html-p-1.html">html</a>基本结构分析的详细内容,更多请关注https://www.sxiaw.com/其它相关文章!</p></span> </div> </article> <aside class="swnetnews"> <div class="lis"> <span><i>推荐内容</i></span> <ul> <li><a href="/doc/9425.html" title="win7系统打开图片显示内存不足怎么办" target="_blank">win7系统打开图片显示内存不足怎么办</a></li><li><a href="/doc/4737.html" title="聊聊一些常用的Oracle查询函数" target="_blank">聊聊一些常用的Oracle查询函数</a></li><li><a href="/doc/8280.html" title="购买微信理财通的图文步骤" target="_blank">购买微信理财通的图文步骤</a></li><li><a href="/doc/3475.html" title="golang怎么将时间戳转换为时间格式" target="_blank">golang怎么将时间戳转换为时间格式</a></li><li><a href="/doc/9678.html" title="如何用上下文管理器扩展 Python 计时器" target="_blank">如何用上下文管理器扩展 Python 计时器</a></li><li><a href="/doc/8308.html" title="使用Pytorch实现对比学习SimCLR 进行自监督预训练" target="_blank">使用Pytorch实现对比学习SimCLR 进行自监督预训练</a></li><li><a href="/doc/728.html" title="一文介绍Golang的内存只读" target="_blank">一文介绍Golang的内存只读</a></li><li><a href="/doc/3110.html" title="python文件的后缀名是什么" target="_blank">python文件的后缀名是什么</a></li><li><a href="/doc/7544.html" title="win10如何使用自带视频剪辑软件" target="_blank">win10如何使用自带视频剪辑软件</a></li><li><a href="/doc/7875.html" title="redis可以用来做什么" target="_blank">redis可以用来做什么</a></li> </ul> </div> </aside> </main> <script> // first, find all the div.code blocks document.querySelectorAll('pre').forEach(el => { // then highlight each hljs.highlightElement(el); hljs.lineNumbersBlock(el); }); </script> <link rel="stylesheet" type="text/css" href="/kan/css/basezb.css"> <script type="text/javascript" src="/kan/js/read.js"></script> <div style="display:none"> <div class="login-box" id="login-dialog"> <div class="login-top"><a rel="nofollow" id="login1" onclick="setTab('login',1,2);" >登录</a></div> <div class="login-form" id="nav-signin"> <!-- <div class="login-ico"><a rel="nofollow" class="qq" id="qqlogin" target="_blank" href="/user-center-qqlogin.html"> QQ </a></div> --> <div class="login-box-form" id="con_login_1"> <form id="loginform" action="/user-center-login.html" method="post" onsubmit="return false;"> <p class="int-text"> <input class="email" id="username" name="username" type="text" value="用户名或Email" onfocus="if(this.value=='用户名或Email'){this.value='';}" onblur="if(this.value==''){this.value='用户名或Email';};" ></p> <p class="int-text"> <input class="password1" type="password" id="password" name="password" value="******" onBlur="if(this.value=='') this.value='******';" onFocus="if(this.value=='******') this.value='';" > </p> <p class="int-info"> <label class="ui-label"> </label> <label for="agreement" class="ui-label-checkbox"> <input type="checkbox" value="" name="cookietime" id="cookietime" checked="checked" value="2592000"> <input type="hidden" name="notforward" id="notforward" value="1"> <input type="hidden" name="dosubmit" id="dosubmit" value="1">记住我的登录 </label> <a rel="nofollow" class="aright" href="/user-center-forgetpwd.html" target="_blank"> 忘记密码? </a></p> <p class="int-btn"><a rel="nofollow" id="loginbt" class="loginbtn"><span>登录</span></a></p> </form> </div> </div> </div> </div> </div> <script type="text/javascript" src="/kan/js/foot_js.js"></script> <div id="footer"> <div class="w1200"> <p class="tips_text">本网站为非赢利性站点,本网站所有内容均来源于互联网相关站点自动搜索采集信息,相关链接已经注明来源。</p> <p class="tips_text">Copyright © 2004-2018 https://www.sxiaw.com/. All Rights Reserved.<script> var _hmt = _hmt || []; (function() { var hm = document.createElement("script"); hm.src = "https://hm.baidu.com/hm.js?fa236be8ec7680639fbd4ee307fd0c69"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s); })(); </script> <a href="http://beian.miit.gov.cn/" target="_blank">津ICP备2023001793号-1</a></p> </div> </div> </body> </html>