search
HomeWeb Front-endHTML Tutorial《HTML5权威指南》_html/css_WEB-ITnose

Adam Freeman 著 谢廷晟 牛化成 刘美英 译 人民邮电出版社。共34章。

零散也是一种 系列!玩也是一种 态度。


1-20章:1、自定义属性data-开头,作用是为了避免与HTML未来版本中可能增加的属性名相冲突。2、XHTML即 HTML的序列化形式,以XML规范表达内容和HTML的元素和属性,以便XML解析程序处理。3、HEAD标签中的元素属于元数据,包括title。4、accesskey="n",窗口系统下,按下ALT+n即可将焦点转移到该元素。5、tabindex属性,用法tabindex="-1/1/2/3",用户按下TAB的过程中,焦点依次从1到2到3。-1时跳过相应元素。6、CSS中@import的效率不如多个元素。7、CSS使用的三种方式(名次),元素内嵌style属性、文档内嵌、外部引用。8、JavaScript删除属性,delete object.prop; OR delete object['prop'];。判断对象是否具有某个属性,in,var hasProp = "prop" in object;9、JavaScript基本类型的比较是值的比较,对象的比较是引用的比较。10、JavaScript基本类型,String(5) OR Number("5")。11、设置基准URL,让文档中的相对链接在此基础上解析。包括 OR 中的href OR src属性等。12、预载入css文件。仅FireFox支持。13、默认情况下,浏览器一遇到script元素就会暂停处理html文档,转而载入脚本文件并执行其中的脚本。在脚本执行完之后浏览器才会继续解析HTML。因此脚本可能报错。解决方法:

  • 将script元素放到文档最后;
  • defer。延迟脚本加载从而影响延迟执行。

14、文档中有一种脚本肯定不会与HTML元素发生相互作用或者产生关系。可以用async属性异步加载脚本来提高其性能,如跟踪脚本。15、元素对搜索引擎很重要。其中包括了很多信息,如application name OR author OR description OR keywords。

  • 。utf-8以最少字节表示Unicode字符。
  • 每隔5秒刷新页面。

16、添加网站标识。如果网站标识文件位于服务器根目录,那就不用使用该属性,浏览器会自动载入。17、margin-start/margin-end/margin-before/margin-after。类似margin-left/margin-right/margin-top/margin-bottom。非通用。18、

标签。这个标签有意思。

<details>  <summary>this is summsary</summary>  this is content.  </details>

19、form标签的name属性不会提交到服务器。其子元素的name属性会提交到服务器。20、fieldset元素对表单进行分组。label元素的for属性设置为对应input的id值,将input元素和label元素关联起来。

<fieldset>  <legend>this is legend</legend>  <p>    <label for="name">Name:<input id="name" name="name" /></label>  </p></fieldset>

21、disabled属性对应元素的数据不会发送到服务器。22、。label设置选项组的一个标题或说明。23、。for属性的值是元素的ID。24、for属性可以将元素关联起来。甚至不用标签包裹就可以相关联。个人感觉这种方式不好,包裹起来更利于维护。25、感觉这些用法很少用。span.class1.class2可以指定不同的类名。[attr~="val"],属性中包含某值。如[class~="red"]表示class属性中含有red值的元素。p span含有空格,表示

标签中所有的标签。p>span直接后代,即子元素。p+a返回p元素之后相邻的一个span元素。p~a,表示p元素之后同级的的所有a元素。26、伪类一个冒号,如:first-child;伪元素两个冒号,如::before。尽管浏览器都当做一个冒号处理,但是为了向后兼容最好区分写法。27、:only-child返回只有一个子元素的元素的子元素。也就是返回没有同级元素的元素。:only-of-type返回一个独有的元素,即该元素和其他元素都不相同。:nth-child(n) OR :nth-last-child(n)选择父元素的第n个子元素与父元素的倒数第n个元素。p:nth-of-type(2) OR p:nth-last-of-type返回第二个p元素与返回倒数第2个p元素。28、em与元素的字号挂钩。font-size: 15pt; height: 2em即2倍字体高度。rem与根元素的字号挂钩。html {font-size: 0.2in;} p {font-size: 2rem; height: 2em;}。font-size: 2rem表示该钙元素字号为根元素字号的2倍。29、border-radius可以用数值或者百分数。百分数值是相当于元素盒子的宽度和高度来说的。border-top-left-raidus: 20px 15px;分别表示水平半径和垂直半径。border-radius: 20px / 15px;用/将水平半径和垂直半径分开。border-radius: 50% 20px 25% 5em / 25% 15px 40px 55%;用/分开的是水平和垂直半径。第一组是四个角的水平半径、第二组是四个角的垂直半径。从top-left到top-right到bottom-left到bottom-right。

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Give an example of an HTML tag with an attribute.Give an example of an HTML tag with an attribute.May 16, 2025 am 12:02 AM

The usage methods of HTML tags and attributes include: 1. Basic usage: Use tags such as and, and add necessary information through attributes such as src and href. 2. Advanced usage: Use data-* custom attributes to achieve complex interactions. 3. Avoid common mistakes: Make sure the property values ​​are surrounded by quotes. 4. Performance optimization: Keep it simple, use standard attributes and CSS class names to ensure that the image has alt attributes. Mastering these will improve web development skills.

What is the difference between an HTML tag and an HTML attribute?What is the difference between an HTML tag and an HTML attribute?May 14, 2025 am 12:01 AM

HTMLtagsdefinethestructureofawebpage,whileattributesaddfunctionalityanddetails.1)Tagslike,,andoutlinethecontent'splacement.2)Attributessuchassrc,class,andstyleenhancetagsbyspecifyingimagesources,styling,andmore,improvingfunctionalityandappearance.

The Future of HTML: Evolution and TrendsThe Future of HTML: Evolution and TrendsMay 13, 2025 am 12:01 AM

The future of HTML will develop in a more semantic, functional and modular direction. 1) Semanticization will make the tag describe the content more clearly, improving SEO and barrier-free access. 2) Functionalization will introduce new elements and attributes to meet user needs. 3) Modularity will support component development and improve code reusability.

Why are HTML attributes important for web development?Why are HTML attributes important for web development?May 12, 2025 am 12:01 AM

HTMLattributesarecrucialinwebdevelopmentforcontrollingbehavior,appearance,andfunctionality.Theyenhanceinteractivity,accessibility,andSEO.Forexample,thesrcattributeintagsimpactsSEO,whileonclickintagsaddsinteractivity.Touseattributeseffectively:1)Usese

What is the purpose of the alt attribute? Why is it important?What is the purpose of the alt attribute? Why is it important?May 11, 2025 am 12:01 AM

The alt attribute is an important part of the tag in HTML and is used to provide alternative text for images. 1. When the image cannot be loaded, the text in the alt attribute will be displayed to improve the user experience. 2. Screen readers use the alt attribute to help visually impaired users understand the content of the picture. 3. Search engines index text in the alt attribute to improve the SEO ranking of web pages.

HTML, CSS, and JavaScript: Examples and Practical ApplicationsHTML, CSS, and JavaScript: Examples and Practical ApplicationsMay 09, 2025 am 12:01 AM

The roles of HTML, CSS and JavaScript in web development are: 1. HTML is used to build web page structure; 2. CSS is used to beautify the appearance of web pages; 3. JavaScript is used to achieve dynamic interaction. Through tags, styles and scripts, these three together build the core functions of modern web pages.

How do you set the lang attribute on the  tag? Why is this important?How do you set the lang attribute on the tag? Why is this important?May 08, 2025 am 12:03 AM

Setting the lang attributes of a tag is a key step in optimizing web accessibility and SEO. 1) Set the lang attribute in the tag, such as. 2) In multilingual content, set lang attributes for different language parts, such as. 3) Use language codes that comply with ISO639-1 standards, such as "en", "fr", "zh", etc. Correctly setting the lang attribute can improve the accessibility of web pages and search engine rankings.

What is the purpose of HTML attributes?What is the purpose of HTML attributes?May 07, 2025 am 12:01 AM

HTMLattributesareessentialforenhancingwebelements'functionalityandappearance.Theyaddinformationtodefinebehavior,appearance,andinteraction,makingwebsitesinteractive,responsive,andvisuallyappealing.Attributeslikesrc,href,class,type,anddisabledtransform

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

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

Hot Tools

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!