当前位置: 首页 > 编程日记 > 正文

HTML学习笔记_002_如何学习HTML

.htm 还是 .html 文件后缀?

当您保存 HTML 文件时,既可以使用 .htm 也可以使用 .html 文件后缀。我们在实例中使用 .htm。这只是长久以来形成的习惯而已,因为过去的很多软件只允许三个字母的文件后缀。

不过对于新的软件,使用 .html 完全没有问题。

在远古时代(DOS时代),后缀只支持短短的三个字符,所以曾经用的是htm,随着时代的发展,这个限制也随之消失,这样,用html和htm都是可以的了,现在的软件也支持了。

学习HTML的最佳方法就是看别人写的代码,我们可以学习不同的网站的人们写出的代码是怎么样的。

一、打开某个网站

http://www.baidu.com

二、点击鼠标右键,选择查看页面源代码

这时候就会出现该页面的代码了

<!doctype html>
<html>
<head><meta http-equiv="Content-Type" content="text/html;charset=gb2312"><title>百度一下,你就知道 </title><style>html{overflow-y:auto}body{font:12px arial;text-align:center;background:#fff}body,p,form,ul,li{margin:0;padding:0;list-style:none}body,form,#fm{position:relative}td{text-align:left}img{border:0}a{color:#00c}a:active{color:#f60}#u{color:#999;padding:4px 10px 5px 0;text-align:right}#u a{margin:0 5px}#u .reg{margin:0}#u .last{margin-right:0}#u .un{color:#00c;text-decoration:underline;padding-right:11px;margin-right:5px;background:url(http://www.baidu.com/img/bg-1.0.1.gif) no-repeat right -195px;cursor:pointer}#u ul{width:100%;background:#fff;border:1px solid #9b9b9b}#u li{height:25px}#u li a{width:100%;height:25px;line-height:25px;display:block;text-align:left;text-decoration:none;text-indent:6px;margin:0;filter:none\9}#u li a:hover{background:#ebebeb}#u li.nl{border-top:1px solid #ebebeb}#userMenu{width:64px;position:absolute;right:7px;_right:2px;top:15px;top:14px\9;*top:15px;padding-top:4px;display:none;*background:#fff}#user{position:relative;display:inline-block}#m{width:680px;margin:0 auto;}#nv a,#nv b,.btn,#lk{font-size:14px}#fm{padding-left:90px;text-align:left}input{border:0;padding:0}#nv{height:19px;font-size:16px;margin:0 0 4px;text-align:left;text-indent:117px;}.s_ipt_wr{width:418px;height:30px;display:inline-block;margin-right:5px;background:url(http://s1.bdstatic.com/r/www/cache/aoyun/img/i-1.0.1.png) no-repeat -304px 0;border:1px solid #b6b6b6;border-color:#9a9a9a #cdcdcd #cdcdcd #9a9a9a;vertical-align:top}.s_ipt{width:405px;height:22px;font:16px/22px arial;margin:5px 0 0 7px;background:#fff;outline:none;-webkit-appearance:none}.s_btn{width:95px;height:32px;padding-top:2px\9;font-size:14px;background:#ddd url(http://s1.bdstatic.com/r/www/cache/aoyun/img/i-1.0.1.png);cursor:pointer}.s_btn_h{background-position:-100px 0}.s_btn_wr{width:97px;height:34px;display:inline-block;background:url(http://s1.bdstatic.com/r/www/cache/aoyun/img/i-1.0.1.png) no-repeat -202px 0;*position:relative;z-index:0;vertical-align:top}#lg img{vertical-align:top;margin-bottom:3px}#lk{margin:33px 0}#lk span{font:14px "宋体"}#lm{height:60px}#lh{margin:16px 0 5px;word-spacing:3px}.tools{position:absolute;top:-4px;*top:10px;right:-13px;}#mHolder{width:62px;position:relative;z-index:296;display:none}#mCon{height:18px;line-height:18px;position:absolute;cursor:pointer;padding:0 18px 0 0;background:url(http://s1.bdstatic.com/r/www/img/bg-1.0.0.gif) no-repeat right -134px;background-position:right -136px\9}#mCon span{color:#00c;cursor:default;display:block}#mCon .hw{text-decoration:underline;cursor:pointer}#mMenu a{width:100%;height:100%;display:block;line-height:22px;text-indent:6px;text-decoration:none;filter:none\9}#mMenu,#user ul{box-shadow:1px 1px 2px #ccc;-moz-box-shadow:1px 1px 2px #ccc;-webkit-box-shadow:1px 1px 2px #ccc;filter: progid:DXImageTransform.Microsoft.Shadow(Strength=2, Direction=135, Color="#cccccc")\9;}#mMenu{width:56px;border:1px solid #9b9b9b;list-style:none;position:absolute;right:7px;top:28px;display:none;background:#fff}#mMenu a:hover{background:#ebebeb}#mMenu .ln{height:1px;background:#ebebeb;overflow:hidden;font-size:1px;line-height:1px;margin-top:-1px}#cp,#cp a{color:#77c}#seth{display:none;behavior:url(#default#homepage)}#setf{display:none;}#sekj{margin-left:14px;}</style><script type="text/javascript">        function h(obj) { obj.style.behavior = 'url(#default#homepage)'; var a = obj.setHomePage('http://www.baidu.com/'); }</script>
</head>
<body><div id="u"><span id="user"><strong class="un">tk657309822</strong><div id="userMenu"><ul><li><a href="http://passport.baidu.com" name="tj_user">个人资料</a></li><li><a href="http://www.baidu.com/home/page/show/setting"name="tj_msg">首页设置</a></li><li><a href="http://www.baidu.com/gaoji/preferences.html"name="tj_setting">搜索设置</a></li><li class="nl"><a href="http://passport.baidu.com/?logout&tpl=mn&u=http%3A%2F%2Fwww.baidu.com%2F"name="tj_logout">退出</a></li></ul></div></span>|<a href="/home/show/home" name="tj_supper" class="last">新版首页</a></div><div id="m"><p id="lg"><img src="http://www.baidu.com/img/baidu_sylogo1.gif" width="270" height="129" usemap="#mp"><mapname="mp"><area shape="rect" coords="40,25,230,95" href="http://hi.baidu.com/baidu/"target="_blank" title="点此进入 百度的空间"></map></p><p id="nv"><a href="http://news.baidu.com">新 闻</a> <b>网 页</b> <a href="http://tieba.baidu.com">贴 吧</a> <a href="http://zhidao.baidu.com">知 道</a> <a href="http://mp3.baidu.com">MP3</a> <a href="http://image.baidu.com">图 片</a> <a href="http://video.baidu.com">视 频</a> <a href="http://map.baidu.com">地 图</a></p><div id="fm"><form name="f" action="/s"><span class="s_ipt_wr"><input type="text" name="wd" id="kw" maxlength="100" class="s_ipt"></span><inputtype="hidden" name="rsv_bp" value="0"><input type="hidden" name="rsv_spt" value="3"><spanclass="s_btn_wr"><input type="submit" value="百度一下" id="su" class="s_btn" οnmοusedοwn="this.className='s_btn s_btn_h'"οnmοuseοut="this.className='s_btn'"></span></form><span class="tools"><span id="mHolder"><div id="mCon"><span>输入法</span></div></span></span><ul id="mMenu"><li><a href="#" name="ime_hw">手写</a></li><li><a href="#" name="ime_py">拼音</a></li><liclass="ln"></li><li><a href="#" name="ime_cl">关闭</a></li></ul></div><p id="lk"><a href="http://baike.baidu.com">百科</a> <a href="http://wenku.baidu.com">文库</a><a href="http://www.hao123.com">hao123</a><span> | <a href="/more/">更多>></a></span></p><p id="lm"></p><p><a id="seth" οnclick="h(this)" href="http://utility.baidu.com/traf/click.php?id=215&url=http://www.baidu.com"οnmοusedοwn="return ns_c({'fm':'behs','tab':'homepage','pos':0})">把百度设为主页</a><a id="setf"href="http://www.baidu.com/cache/sethelp/index.html" οnmοusedοwn="return ns_c({'fm':'behs','tab':'favorites','pos':0})"target="_blank">把百度设为主页</a><span id="sekj"><a href="http://www.baidu.com/search/baidukuijie_mp.html"target="_blank" οnmοusedοwn="return ns_c({'fm':'behs','tab':'kuaijie','pos':1})">把百度添加到桌面</a></span></p><p id="lh"><a href="http://e.baidu.com/?refer=888">加入百度推广</a> | <a href="http://top.baidu.com">搜索风云榜</a> | <a href="http://home.baidu.com">关于百度</a> | <a href="http://ir.baidu.com">About Baidu</a></p><p id="cp">©2012 Baidu <a href="/duty/">使用百度前必读</a> <a href="http://www.miibeian.gov.cn"target="_blank">京ICP证030173号</a><img src="http://www.baidu.com/cache/global/img/gs.gif"></p></div>
</body>
<script>    var bds = { se: {}, comm: { ishome: 1, sid: "1288_1328_1264_1186_1281_1303_1285_1320_1295_1332", user: "tk657309822", username: "tk657309822", sugHost: "http://suggestion.baidu.com/su", loginAction: []} }</script>
<script type="text/javascript" src="http://s1.bdstatic.com/r/www/cache/global/js/home-1.2.js"></script>
<script>    var bdUser = "tk657309822"; var w = window, d = document, n = navigator, k = d.f.wd, a = d.getElementById("nv").getElementsByTagName("a"), isIE = n.userAgent.indexOf("MSIE") != -1 && !window.opera; for (var i = 0; i < a.length; i++) { a[i].onclick = function () { if (k.value.length > 0) { var o = this, h = o.href, q = encodeURIComponent(k.value); if (h.indexOf("q=") != -1) { o.href = h.replace(/q=[^&\x24]*/, "q=" + q) } else { this.href += "?q=" + q } } } }; (function () { if (/q=([^&]+)/.test(location.search)) { k.value = decodeURIComponent(RegExp["\x241"]) } })(); if (n.cookieEnabled && !/sug?=0/.test(d.cookie)) { bds.se.sug(); }; function addEV(o, e, f) { if (w.attachEvent) { o.attachEvent("on" + e, f); } else if (w.addEventListener) { o.addEventListener(e, f, false); } } function G(id) { return d.getElementById(id); } function ns_c(q) { var p = encodeURIComponent(window.document.location.href), sQ = '', sV = '', mu = '', img = window["BD_PS_C" + (new Date()).getTime()] = new Image(); for (v in q) { sV = q[v]; sQ += v + "=" + sV + "&"; } mu = "&mu=" + p; img.src = "http://nsclick.baidu.com/v.gif?pid=201&pj=www&rsv_sid=1288_1328_1264_1186_1281_1303_1285_1320_1295_1332&" + sQ + "path=" + p + "&t=" + new Date().getTime(); return true; } if (/\bbdime=[12]/.test(d.cookie)) { document.write('<script src=http://s1.bdstatic.com/r/www/cache/ime/js/openime-1.0.0.js><\/script>'); } (function () { var u = G("u").getElementsByTagName("a"), nv = G("nv").getElementsByTagName("a"), lk = G("lk").getElementsByTagName("a"), un = ""; var tj_nv = ["news", "tieba", "zhidao", "mp3", "img", "video", "map"]; var tj_lk = ["baike", "wenku", "hao123", "more"]; un = bds.comm.user == "" ? "" : bds.comm.user; function _addTJ(obj) { addEV(obj, "mousedown", function (e) { var e = e || window.event; var target = e.target || e.srcElement; ns_c({ 'fm': 'behs', 'tab': target.name || 'tj_user', 'un': encodeURIComponent(un) }); }); } for (var i = 0; i < u.length; i++) { _addTJ(u[i]); } for (var i = 0; i < nv.length; i++) { nv[i].name = 'tj_' + tj_nv[i]; _addTJ(nv[i]); } for (var i = 0; i < lk.length; i++) { lk[i].name = 'tj_' + tj_lk[i]; _addTJ(lk[i]); } })(); addEV(w, "load", function () { k.focus() }); w.onunload = function () { };</script>
<script type="text/javascript" src="http://s1.bdstatic.com/r/www/cache/global/js/tangram-1.3.4c1.0.js"></script>
<script type="text/javascript" src="http://s1.bdstatic.com/r/www/cache/user/js/u-1.3.1.js"></script>
<script type="text/javascript" src="http://s1.bdstatic.com/r/www/cache/aoyun/js/aoyun-1.1.js"></script>
</html>
<!--e75fa6eef066b24c-->

处理常规的HTML,还包含了很多的其他东西,它们联合在一起,为我们提供更好的视图和功能。

相关文章:

设计1.0 -- iterator 和const_iterator底层的模拟实现

本文概要&#xff1a; 本文主要是模拟实现STL中迭代器和const迭代器的&#xff0c;主要阐述的一个问题就是&#xff0c;为什么我们在设计迭代器的时候需要使用三个模板参数呢 在设计迭代器的时候&#xff0c;我们有下面的代码 #include<iostream> using namespace std…

关于python缩进的描述中_关于Python程序中与“缩进”有关的说法中,以下选项中正确的是()...

关于Python程序中与“缩进”有关的说法中,以下选项中正确的是()答&#xff1a;缩进在程序中长度统一且强制使用同文学或同音乐主题的民歌&#xff0c;《_______》是其中之一。此曲经民间艺人丁喜才改编后&#xff0c;由上海音乐学院鞠秀芳于50年代在国际上唱红答&#xff1a;五…

使用Newtonsoft.Json

首先是前一段某博友对于循环引用的问题的解决&#xff1a;http://www.cnblogs.com/Gryzor/archive/2013/05/06/3062373.html 其次是时间到底是UTC还是Local的问题&#xff1a;http://www.cnblogs.com/leonwang/archive/2013/05/29/javascript-datetime.html 对于第二条&#xf…

回击质疑 HP StoreOnce用高性能说话

四五年以前&#xff0c;记者曾经两次参观过惠普位于英国西南部港口城市布里斯托尔的存储研究中心&#xff0c;那里是惠普数据备份和保护产品的大本营&#xff0c;同时也是惠普磁带产品与HP StoreOnce产品家族的诞生地。就在惠普刚刚发布升级版的HP StoreOnce B6200以及Catalyst…

windows10配置jenkins

1、下载pscp.exe并拷贝到c:\window\system32&#xff0c;此工具用于上传文件至linux服务器 下载地址&#xff1a;https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html 2、下载jenkins.war 下载地下&#xff1a;https://jenkins.io/download/ 3、设置环境变量JENKI…

STL模拟实现1.0 -- list和iterator模拟实现和简单分析

引言 C 标准模本库《STL》中有很多优秀的代码实现&#xff0c;不然怎么能叫做C标准模板库呢&#xff0c;其中一个实现就是有一个容器&#xff0c;叫做list。所谓容器其实就是存储相同类型数据的一个存储集合&#xff0c;list的底层实现其实就是一个链表。 我们的普通数组在使…

hdc mfc 画扇形图_使用echarts绘制条形图和扇形图

使用echarts绘制条形图和扇形图简单举例说明下echarts如何绘制条形图和扇形图代码示例echarts绘制条形图和扇形图var mychart1echarts.init(document.getElementById(chart1),light);// 指定图表的配置项和数据var option {title: {text: ECharts 入门示例},tooltip: {},legen…

Java学习笔记45:Java 线程与主线程之间的变量关系

运行下面的代码&#xff1a; package com.test.www;public class Test {public static int count 0;public static void inc() {//这里延迟1毫秒&#xff0c;使得结果明显try {Thread.sleep(1);} catch (InterruptedException e) {}count;}public static void main(String[] a…

会计的思考(36):会计--企业运营的数码相机

新浪网上看到一张图片&#xff0c;拍的是2009年12月3日的武汉市&#xff0c;整个城市在笼罩在一片污浊空气当中&#xff0c;让人震惊。虽然我在深圳&#xff0c;但也清楚好不到哪去。 震惊之余&#xff0c;感谢新浪&#xff0c;更感谢某位摄影师&#xff0c;让我们了解到生活的…

spring cloud连载第二篇之Spring Cloud Config

Spring Cloud Config Spring Cloud Config为分布式服务提供了服务侧和客户侧的外部配置支持。通过Spring Cloud Config你可以有一个统一的地方来管理所有应用的外部配置。 默认服务端存储实现用的是git&#xff0c;因此&#xff0c;它很容易支持配置环境的标签版本&#xff0c;…

CodeOnly

关于设置[Key]标志 要先添加 程序集的引用 在添加 using System.ComponentModel.DataAnnotations; 命名控件转载于:https://www.cnblogs.com/since87/archive/2013/06/09/3129399.html

继承和多态 2.0 -- 继承的六个默认成员函数

本文重要介绍普通继承中如何写派生类的六个默认成员函数&#xff0c;主要是针对在派生类中&#xff0c;如何调用基类的六个默认成员函数 需要说明的一点就是&#xff0c;如果子类中没有调用父类的函数时&#xff0c;系统会自动生成一个。 构造函数 子类中有父类的成员&#…

js 让鼠标右下角有一排小字_js布局中一排大字下面接着一排小字怎么打出来?...

展开全部可以使用 TypewriterJS 实现效果是这样 ,百度图片少了一部分&#xff0c;可以通过链接32313133353236313431303231363533e78988e69d8331333433626438看效果链接: 网页链接示例在这里: 网页链接文档地址: 网页链接使用步骤引用 TypewriterJShtmlcss.article__title {fon…

Hudson神奇的环境变量

Hudson神奇的环境变量 http://blog.sina.com.cn/s/blog_798f21a00100z6zw.html转载于:https://blog.51cto.com/myloveworld/950156

英语影视台词---四、Sideways

英语影视台词---四、Sideways 一、总结 一句话总结&#xff1a;杯酒人生 Sideways&#xff0c;大致意思是“偏离、倾斜、转向…”。很明显中文译名与英文原名并没有什么关联&#xff0c;《杯酒人生》这个名字&#xff0c;其实也可以译为《并肩前行》&#xff0c;应该是从影片内…

继承和多态 3.0 -- 菱形继承

单继承和多继承 C的继承方式是支持单继承和多继承的&#xff0c;首先看一下代码&#xff0c;分清单继承和多继承 单继承 class A { public:int _a; };class B :public A { public:int _b; };class C : public A { public:int _c; }; 类似于上面的方式就是单继承&#xff0c;或…

C# split 几种使用方法

第一种方法&#xff1a; string s "abcdeabcdeabcde"; string[] sArray s.Split(c); foreach (string i in sArray) Console.WriteLine(i.ToString()); Console.ReadKey();输出下面的结果:abdeabdeabd…

模糊匹配 读音_onenote搜索机制详解②:两种搜索模式,模糊与精确匹配

先从纯文本搜索讲起&#xff0c;这是最基本也是最重要的。从这篇开始&#xff0c;以及接下来连续几篇文章&#xff0c;都会介绍搜索的基础功能。注意&#xff0c;这几篇文章中谈论的都是基本的、正常的搜索功能&#xff0c;暂时不考虑Bug等因素。在很多软件&#xff08;例如wor…

EXT3与EXT4的主要区别

Linux kernel 自 2.6.28 开始正式支持新的文件系统 Ext4。 Ext4 是 Ext3 的改进版&#xff0c;修改了 Ext3 中部分重要的数据结构&#xff0c;而不仅仅像 Ext3 对 Ext2 那样&#xff0c;只是增加了一个日志功能而已。Ext4 可以提供更佳的性能和可靠性&#xff0c;还有更为丰富的…

Java IO 4 : RandomAccessFile

RandomAccessFile:   认识&#xff1a;java输入/输出流体系中功能最丰富的文件内容访问类 既可以读取文件内容&#xff0c;也可以向文件传输数据&#xff0c;并且支持“随机访问“的方式&#xff0c;程序可以跳转到任意地方来读写数据。 特点&#xff1a;与OutputStream/Writ…

二叉树 1.0 -- 创建二叉树、遍历二叉树、二叉树常见问题求解

树的结构主要是为了查找&#xff0c;这个主要是为了搜索&#xff0c;树的结构关注的不是增删查改 树 广义上面的树的结构我们不知道树的一个节点是有几个子节点的&#xff0c;所以这个时候我们需要定义的一种结构就是&#xff0c;一个节点的孩子是可以动态的增加的&#xff0…

impala 本年格式化时间_hive,hbase,impala之间的对比

hbase在三者中更注重的是存储&#xff0c;它实现了类似mysql的double write机制&#xff0c;但是它是一种NoSQL的数据库&#xff0c;并且是可以支持列式存储的&#xff0c;算是比较大的一个内存Hash表。hbase也采用了类似mysql中的mvcc的思想通过时间戳来做版本控制。hbase是在…

简单上手的游戏引擎

物理游戏引擎 GameSalad 转载于:https://www.cnblogs.com/sgdkg/archive/2013/06/14/3135882.html

Linux内核中关于定时器Timer的应用

2019独角兽企业重金招聘Python工程师标准>>> 在Touchscreen驱动中 1 声明 Ad7877.c (\linux-2.6.30.4\drivers\input\touchscreen): struct timer_list timer; /* P: lock */ 2 初始化 在函数 static int __devinit ad7877_probe(struct spi_device *spi) 中 执行 …

类加载过程中几个重点执行顺序整理

类的加载过程&#xff1a; 1、 JVM会先去方法区中找有没有相应类的.class存在。如果有&#xff0c;就直接使用&#xff1b;如果没有&#xff0c;则把相关类的.class加载到方法区 2、 在.class加载到方法区时&#xff0c;会分为两部分加载&#xff1a;先加载非静态内容&#xff…

二叉树 2.0 -- 非递归遍历

二叉树递归遍历存在的问题 如果我们的二叉树只有左子树&#xff0c;而且树的高度还很深的时候&#xff0c;这个时候递归调用遍历的时候&#xff0c;栈帧空间开辟的较大&#xff0c;很可能造成栈溢出。但是我们一个程序中&#xff0c;为堆分配的空间要比栈大的多&#xff0c;这…

田忌赛马贪心算法_田忌赛马 贪心算法

算法实验课回顾田忌赛马问题描述&#xff1a;你一定听说过田忌赛马的故事吧&#xff1f;如果3匹马变成n匹(n<100)&#xff0c;齐王仍然让他的马按照优到劣的顺序初赛&#xff0c;田忌可以按任意顺序选择他的赛马出赛。赢一局&#xff0c;田忌可以得到200两银子&#xff1b;输…

[转][小结][三种方法]实现WPF不规则窗体

实现WPF不规则窗体的三种常用的方法如下&#xff1a; 1.使用Blend等工具绘制一个不规则xaml&#xff0c;然后作为窗体的背景。这个可以参考xiaowei0705的这篇博文&#xff1a;WPF制作不规则的窗体 。 2.给window的Clip属性赋Path值。这个可以参考DebugLZQ前面的博文&#xff1a…

VirtualBox虚拟机网络连接设置的四种方式

这里我先给大家大致讲解下VBox的网络配置及应用。 VirtualBox的提供了四种网络接入模式&#xff0c;它们分别是&#xff1a;1、NAT 网络地址转换模式(NAT,Network Address Translation)2、Bridged Adapter 桥接模式3、Internal 内部网络模式4、Host-only Adapter 主机…

redis-deskmanager 连不上 虚拟机 - centos redis

1、没设置redis密码 &#xff1a; https://blog.csdn.net/HUXU981598436/article/details/54668779 2、关闭防火墙 转载于:https://www.cnblogs.com/Jomini/p/9650650.html