1. html基础
html是用来制作网页的标记语言,不需编译,直接由浏览器执行。大小写不敏感,推荐使用小写。html文件必须使用html或htm为文件名后缀。
html主体结构:
(1)DTD头:用于告诉浏览器用什么标准解析当前页面
(2)head部分:告诉浏览器一些相应信息
(3)body部分:给人看的数据
2. html语言的语法
2.1 html标签
标签是html中最基本单位,也是最重要的组成部分,用角括号括起来。
标签都是闭合的,有两种形式:内容 ;
有三部分组成:标签名,要显示的数据,显示数据的属性
标签名>
2.2 html注释
2.3 html代码格式
回车和空格在源代码中不起作用,所以在编写html代码时可以使用回车或空格进行排版,可使代码清晰,也便于团队合作。必须保持严格的缩进规则,以“Tab”键为准。
把代码写得漂亮比把代码写得正确更重要。
3. head部分
表示html文档的头信息,以
开始,以结束。包含了当前文档的一些信息,例如标题信息,meta信息等,正常情况下头信息是不会显示在html文档中的。
常用标签:
title标签--代表html文档的标题
base标签--将相对URL转换为完整的绝对URL
meta标签--用于定义文件信息的名称、内容等信息
link标签--当在文档中声明使用外接资源(如CSS)时使用此标签
style标签--在文档中声明样式时使用此标签
script标签--在文档中使用JavaScript脚本
4.body标签中的常用属性(注意默认值)
text-------设置页面文字的颜色
bgcolor---------设置页面的背景颜色
background-------设置页面背景图片
bgroperties-------设定页面背景图像为固定,不随页面滚动而滚动
link--------设定页面默认的链接颜色
alink-----------设定鼠标正在点击时的颜色
vlink-----------设定访问后链接文字的颜色
topmargin-----------设定页面的上边距
leftmargin-------------设定页面的左边距
5. 文字版面的编辑
5.1 格式标签
换行标签
段落标签,里边可加入文字、列表、表格等
按原文显示标签,可把原文件中的空格,回车,换行,tab键表现出来 <p></p>
- html无序列表
- html有序列表
水平分割线标签,用于段落与段落间的分割
5.2 文本标签
粗体字标签
斜体字标签
下划线字体标签
文字上标字体标签
文字下表字体标签
字体标签,可通过标签的属性指定文字的大小、颜色及字体等属性
打字机文字
用于引证、举例,通常为斜体字
表示强调,通常为斜体字
表示强调,通常为粗体字
小型字体标签
大型字体标签
6. 插入图像
img标签,单独出现,
常用属性:
alt-------代表图像的替代文字
src------图像源(即图像的位置)
border-------图片边框的宽度
height--------图像的高度
width---------图像的宽度
设计网页时常用的图片格式:gif,jpeg,png
7. 建立锚点和超链接
7.1 a标签-------代表html链接,成对出现…
常用属性:
href---------代表一个url链接源
url可以是网页,其他的文件,指向HTML文件中的一个位置,email地址
target---------用来指出链接打开方式
target=_blank:将链接内容在新的窗口中打开
target=_parent:将链接的内容当成文件的上一个画面
target=_self:将链接的内容显示在当前窗口
target=_top:使整个画面重新显示成链接的画面内容
链接语法:
7.2 定位网页内部的链接(锚点链接)
用定义,如:第一部分,使用跳转到第一部分,超链接就可以定位到网页中的“第一部分”这个位置。
7.3 超链接
三种链接路径:
绝对路径:http://www.sohu.com/index.html
文档相对路径:adver/contents.html
站点根目录相对路径:/support/app/customer.html
8. html表格
8.1 常见标签
表中的一列 tr、th属性: width与height------代表宽度和高度 colspan---------一行跨越多列 Rowspan--------一列跨越多行 align-------------水平对齐方式(left,center,right) valign----------竖直对齐方式(top,middle,bottom) |
表中的一个单元格,用于存放具体数据内容 align,valign具体解释详见上面 9. html框架结构 9.1 简述 一个浏览器窗体可通过几个页面的组合来显示。可使用框架(frames)来完成。可分为数行和数列。 优点:重载页面时不需重载整个页面;方便制作导航栏。 缺点:会产生很多页面,不易管理;不易打印;浏览器的后退按钮无效;代码复杂,无法被一些搜索引擎索引到;多数小型的移动设备(PDA手机)无法完全显示框架;多框架的页面会增加服务器的http请求 由于这许多缺点,不符合标准网页设计的理念,已被标准网页设计抛弃 9.2 html框架标签 |
---|

HTML is a language used to build web pages, defining web page structure and content through tags and attributes. 1) HTML organizes document structure through tags, such as,. 2) The browser parses HTML to build the DOM and renders the web page. 3) New features of HTML5, such as, enhance multimedia functions. 4) Common errors include unclosed labels and unquoted attribute values. 5) Optimization suggestions include using semantic tags and reducing file size.

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

The role of HTML is to define the structure and content of a web page through tags and attributes. 1. HTML organizes content through tags such as , making it easy to read and understand. 2. Use semantic tags such as, etc. to enhance accessibility and SEO. 3. Optimizing HTML code can improve web page loading speed and user experience.

HTMLisaspecifictypeofcodefocusedonstructuringwebcontent,while"code"broadlyincludeslanguageslikeJavaScriptandPythonforfunctionality.1)HTMLdefineswebpagestructureusingtags.2)"Code"encompassesawiderrangeoflanguagesforlogicandinteract

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.

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.

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.

AnexampleofastartingtaginHTMLis,whichbeginsaparagraph.StartingtagsareessentialinHTMLastheyinitiateelements,definetheirtypes,andarecrucialforstructuringwebpagesandconstructingtheDOM.


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

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

WebStorm Mac version
Useful JavaScript development tools