简单理解网页源码(HTML源代码)_html/css_WEB-ITnose
程序员无论做什么程序, 基本都会接触HTML, 如果做web开发 这就是吃饭的家伙, 移动端APP 的没学过HTML不要紧, 但是要一眼大概可以看懂网页源代码, 有机会最好亲自学习一下HTML5, 最自身的提高还是有所帮助的
HTML, 超文本标记语言. 简单理解为某些字句加上标志的语言,从而实现预期的特定效果。网页正是由这种HTML语言所编写出来的。作为一套标记语言,基本上只要明白各种标记的用法就算学会了HTML
HTML的语法格式分为嵌套与非嵌套两类,嵌套格式为<标记>...</标记>,非嵌套只为<标记>。此外,根据标记的不同,有的标记附带有属性参数,则表示为<标记 属性="参数值">,根据个人需要,可添加或去掉相应的属性标记
一. 基本框架
如同人一样,网页也包括了“头部”和“身体”,如图就是标记符号。
<head>标记内包含着诸如网页标题、语言编码、网页描述等基本信息,而平时我们真正见到的网页内容均放在<body>标记内。现在先介绍一下<head>里的基本信息。
网页标题(标记格式为<title></title>)
创建网页标题文字:<title>标题</title> //此处书写的文字会显示在IE的标题栏上。
网页文档信息(标记格式为<meta>)
描述网页内容类型:<meta http-equiv="Content-Type" content="text/html; charset=gb2312"> //该页面为TXT文本或HTML格式,语言编码方式为GB2312(即简体中文)。
描述网页的关键字信息:<meta name="keywords" content="这里是关键字">
对网页的详细描述:<meta name="description" content="这里是对该网页的介绍">
刷新网页:<meta http-equiv="refresh" content="5;URL=xxx.htm"> //5秒种后刷新,并链接到xxx.html
二、组成要素
无论网页如何千变万化,构成一个网页内容的最基本要素大体只有五种,即文字、图片、表格、超链接和表单控件,所以下面将围绕着这五个要素逐一列举介绍。
文字(标记格式为<font></font>)
指定文字字体:<font face="宋体">宋体文字</font>
指定文字大小:<font size="3">3号文字</font>
指定文字颜色:<font color="#FF0000">红色文字</font> //网页颜色采用16位编码,因此#FF0000表现为红色。大家可以查阅相关资料了解其他颜色的编码。
图片(标记格式为<img>)
<img src="/Files/Pic/2006-9/4/069409563356425.jpg" width="400" height="300" border="2" align="center">// src指定为路径地址,width为宽度,height为高度,border为边框大小,align为横向位置。
表格(标记格式为<table><tr><td></td></tr></table>)
<table width="400" height="300" border="1" align="center" cellpadding="2" cellspacing="2" bgcolor="#FF0000"><tr><td>此处添加文字或图片等</td></tr></table>// width、height、border、align与以上的例子作用一样,cellpadding为边框与单元格的间距,cellspacing为单元格之间的间距,bgcolor为表格背景色。
以上所介绍的元素都是只存在当前页中,而网页超链接的出现大大改变了人们的浏览习惯,可根据自己喜好,点击到相关链接查看网页信息。
超链接(标记格式为<a></a>)
<a href="xxx.htm" title="提示文字">链接文字或图片</a> //href为被点击后的链接页,title为鼠标悬停在链接文字或图片上后出现的提示文字。
表单控件(标记符号为<input>、<textarea></textarea>、<select></select>)
表单控件实现了人与网页的交互,像大家常去的论坛、购物站点等都有它的“身影”。
文本框:<input type="text" value="这是文本框"> //value为该控件的值,以下每个表单控件均可设定,不设默认为空
密码框:<input type="password">
单选框:<input type="radio">
复选框:<input type="check">
提交按钮:<input type="submit">
重置按钮:<input type="reset">
隐藏区域:<input type="hidden">
文本域:<textarea rows="6" cols="30"></textarea> //rows为行数,cols为宽度
列表框:<select><option>项目1<option>项目2<option>项目3</select>
, 查看HTML网页源代码 可以了解网页的内容, 结构, 根据我们自己的需求对网页中的数据进行更改, 过滤, 排版. 所以多学一门语言有益无害, 活到老 学到老.

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

HTML is suitable for beginners because it is simple and easy to learn and can quickly see results. 1) The learning curve of HTML is smooth and easy to get started. 2) Just master the basic tags to start creating web pages. 3) High flexibility and can be used in combination with CSS and JavaScript. 4) Rich learning resources and modern tools support the learning process.

HTML defines the web structure, CSS is responsible for style and layout, and JavaScript gives dynamic interaction. The three perform their duties in web development and jointly build a colorful website.

AnexampleofastartingtaginHTMLis,whichbeginsaparagraph.StartingtagsareessentialinHTMLastheyinitiateelements,definetheirtypes,andarecrucialforstructuringwebpagesandconstructingtheDOM.

WebdevelopmentreliesonHTML,CSS,andJavaScript:1)HTMLstructurescontent,2)CSSstylesit,and3)JavaScriptaddsinteractivity,formingthebasisofmodernwebexperiences.

GiteePages static website deployment failed: 404 error troubleshooting and resolution when using Gitee...

The Y-axis position adaptive algorithm for web annotation function This article will explore how to implement annotation functions similar to Word documents, especially how to deal with the interval between annotations...

HTML, CSS and JavaScript are the three pillars of web development. 1. HTML defines the web page structure and uses tags such as, etc. 2. CSS controls the web page style, using selectors and attributes such as color, font-size, etc. 3. JavaScript realizes dynamic effects and interaction, through event monitoring and DOM operations.

To achieve the effect of scattering and enlarging the surrounding images after clicking on the image, many web designs need to achieve an interactive effect: click on a certain image to make the surrounding...
