XHTML 笔记

原文出自 http://www.w3schools.com 中的 XHTML 教程


XHTML 结合 HTML 和 XML。

XHTML 元素必须严格的嵌套。
XHTML 元素必须总是闭合的。
XHTML 元素必须是小写的。XHTML 文档必须有根元素。

所有的 XHTML 文档必须有 DOCTYPE 声明。
DOCTYPE 声明必须是 XHTML 文档的第一行。

有 3 种文档类型定义: STRICT TRANSITIONAL FRAMESET
xml 代码
 
  1. <!DOCTYPE html PUBLIC  
  2. "-//W3C//DTD XHTML 1.0 Strict//EN"   
  3. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">  
  4.   
  5. <!DOCTYPE html PUBLIC  
  6. "-//W3C//DTD XHTML 1.0 Transitional//EN"  
  7. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  8.   
  9. <!DOCTYPE html PUBLIC  
  10. "-//W3C//DTD XHTML 1.0 Frameset//EN"  
  11. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">  



属性名称必须小写。
属性值必须用引号。
属性最简化被禁止。 如,
xml 代码
  1. <input type="checkbox" checked />

id 属性代替 name 属性。
单标签在末尾 / 之前有空格。 例如:
xml 代码
  1. <br />


XHTML 文档由三个主要的部分构成: DOCTYPE Head Body。
基本文档结构如下:
xml 代码
 
  1. <!DOCTYPE ...>  
  2. <html>  
  3. <head>  
  4. <title>... </title>  
  5. </head>  
  6. <body> ... </body>  
  7. </html>  


核心属性(不可用于 base, head, html, meta, param, script, style, 和 title 元素)
AttributeValueDescription
classclass_rule or style_ruleThe class of the element
idid_nameA unique id for the element
stylestyle_definitionAn inline style definition
titletooltip_text A text to display in a tool tip

语言属性(不可用于 base, br, frame, frameset, hr, iframe, param, 和 script 元素)
AttributeValueDescription
dirltr | rtlSets the text direction
langlanguage_codeSets the language code

键盘属性
AttributeValueDescription
accesskeycharacterSets a keyboard shortcut to access an element
tabindexnumberSets the tab order of an element

窗体事件(只有 body 和 frameset 元素可用)
AttributeValueDescription
onloadscriptScript to be run when a document loads
onunloadscriptScript to be run when a document unloads

表单元素事件(只在表单元素中有效)
AttributeValueDescription
onchangescriptScript to be run when the element changes
onsubmitscriptScript to be run when the form is submitted
onresetscriptScript to be run when the form is reset
onselectscript Script to be run when the element is selected
onblurscript Script to be run when the element loses focus
onfocusscript Script to be run when the element gets focus

键盘事件(不可用于 base, bdo, br, frame, frameset, head, html, iframe, meta, param, script, style, 和 title 元素)
AttributeValueDescription
onkeydownscript What to do when key is pressed
onkeypressscript What to do when key is pressed and released
onkeyupscript What to do when key is released

鼠标事件(不可用于 base, bdo, br, frame, frameset, head, html, iframe, meta, param, script, style, 和 title 元素)
AttributeValueDescription
onclickscript What to do on a mouse click
ondblclickscript What to do on a mouse doubleclick
onmousedownscript What to do when mouse button is pressed
onmousemovescript What to do when mouse pointer moves
onmouseoverscriptWhat to do when mouse pointer moves over an element
onmouseoutscriptWhat to do when mouse pointer moves out of an element
onmouseupscript What to do when mouse button is released

HTTP 响应信息:

1xx: Information

Message:Description:
100 Continue Only a part of the request has been received by the server, but as long as it has not been rejected, the client should continue with the request
101 Switching ProtocolsThe server switches protocol

2xx: Successful

Message:Description:
200 OKThe request is OK
201 CreatedThe request is complete, and a new resource is created
202 AcceptedThe request is accepted for processing, but the processing is not complete
203 Non-authoritative Information 
204 No Content 
205 Reset Content 
206 Partial Content 

3xx: Redirection

Message:Description:
300 Multiple ChoicesA link list. The user can select a link and go to that location. Maximum five addresses
301 Moved PermanentlyThe requested page has moved to a new url
302 FoundThe requested page has moved temporarily to a new url
303 See OtherThe requested page can be found under a different url
304 Not Modified 
305 Use Proxy 
306 UnusedThis code was used in a previous version. It is no longer used, but the code is reserved
307 Temporary RedirectThe requested page has moved temporarily to a new url

4xx: Client Error

Message:Description:
400 Bad RequestThe server did not understand the request
401 UnauthorizedThe requested page needs a username and a password
402 Payment RequiredYou can not use this code yet
403 ForbiddenAccess is forbidden to the requested page
404 Not FoundThe server can not find the requested page
405 Method Not AllowedThe method specified in the request is not allowed
406 Not AcceptableThe server can only generate a response that is not accepted by the client
407 Proxy Authentication RequiredYou must authenticate with a proxy server before this request can be served
408 Request TimeoutThe request took longer than the server was prepared to wait
409 ConflictThe request could not be completed because of a conflict
410 GoneThe requested page is no longer available
411 Length RequiredThe "Content-Length" is not defined. The server will not accept the request without it
412 Precondition FailedThe precondition given in the request evaluated to false by the server
413 Request Entity Too LargeThe server will not accept the request, because the request entity is too large
414 Request-url Too LongThe server will not accept the request, because the url is too long. Occurs when you convert a "post" request to a "get" request with a long query information
415 Unsupported Media TypeThe server will not accept the request, because the media type is not supported
416  
417 Expectation Failed 

5xx: Server Error

Message:Description:
500 Internal Server ErrorThe request was not completed. The server met an unexpected condition
501 Not ImplementedThe request was not completed. The server did not support the functionality required
502 Bad GatewayThe request was not completed. The server received an invalid response from the upstream server
503 Service UnavailableThe request was not completed. The server is temporarily overloading or down
504 Gateway TimeoutThe gateway has timed out
505 HTTP Version Not SupportedThe server does not support the "http protocol" version
资源下载链接为: https://pan.quark.cn/s/abbae039bf2a 无锡平芯微半导体科技有限公司生产的A1SHB三极管(全称PW2301A)是一款P沟道增强型MOSFET,具备低内阻、高重复雪崩耐受能力以及高效电源切换设计等优势。其技术规格如下:最大漏源电压(VDS)为-20V,最大连续漏极电流(ID)为-3A,可在此条件下稳定工作;栅源电压(VGS)最大值为±12V,能承受正反向电压;脉冲漏极电流(IDM)可达-10A,适合处理短暂高电流脉冲;最大功率耗散(PD)为1W,可防止器件过热。A1SHB采用3引脚SOT23-3封装,小型化设计利于空间受限的应用场景。热特性方面,结到环境的热阻(RθJA)为125℃/W,即每增加1W功率损耗,结温上升125℃,提示设计电路时需考虑散热。 A1SHB的电气性能出色,开关特性优异。开关测试电路及波形图(图1、图2)展示了不同条件下的开关性能,包括开关上升时间(tr)、下降时间(tf)、开启时间(ton)和关闭时间(toff),这些参数对评估MOSFET在高频开关应用中的效率至关重要。图4呈现了漏极电流(ID)与漏源电压(VDS)的关系,图5描绘了输出特性曲线,反映不同栅源电压下漏极电流的变化。图6至图10进一步揭示性能特征:转移特性(图7)显示栅极电压(Vgs)对漏极电流的影响;漏源开态电阻(RDS(ON))随Vgs变化的曲线(图8、图9)展现不同控制电压下的阻抗;图10可能涉及电容特性,对开关操作的响应速度和稳定性有重要影响。 A1SHB三极管(PW2301A)是高性能P沟道MOSFET,适用于低内阻、高效率电源切换及其他多种应用。用户在设计电路时,需充分考虑其电气参数、封装尺寸及热管理,以确保器件的可靠性和长期稳定性。无锡平芯微半导体科技有限公司提供的技术支持和代理商服务,可为用户在产品选型和应用过程中提供有
资源下载链接为: https://pan.quark.cn/s/9648a1f24758 在 JavaScript 中实现点击展开与隐藏效果是一种非常实用的交互设计,它能够有效提升用户界面的动态性和用户体验。本文将详细阐述如何通过 JavaScript 实现这种功能,并提供一个完整的代码示例。为了实现这一功能,我们需要掌握基础的 HTML 和 CSS 知识,以便构建基本的页面结构和样式。 在这个示例中,我们有一个按钮和一个提示框(prompt)。默认情况下,提示框是隐藏的。当用户点击按钮时,提示框会显示出来;再次点击按钮时,提示框则会隐藏。以下是 HTML 部分的代码: 接下来是 CSS 部分。我们通过设置提示框的 display 属性为 none 来实现默认隐藏的效果: 最后,我们使用 JavaScript 来处理点击事件。我们利用事件监听机制,监听按钮的点击事件,并通过动态改变提示框的 display 属性来实现展开和隐藏的效果。以下是 JavaScript 部分的代码: 为了进一步增强用户体验,我们还添加了一个关闭按钮(closePrompt),用户可以通过点击该按钮来关闭提示框。以下是关闭按钮的 JavaScript 实现: 通过以上代码,我们就完成了点击展开隐藏效果的实现。这个简单的交互可以通过添加 CSS 动画效果(如渐显渐隐等)来进一步提升用户体验。此外,这个基本原理还可以扩展到其他类似的交互场景,例如折叠面板、下拉菜单等。 总结来说,JavaScript 实现点击展开隐藏效果主要涉及 HTML 元素的布局、CSS 的样式控制以及 JavaScript 的事件处理。通过监听点击事件并动态改变元素的样式,可以实现丰富的交互功能。在实际开发中,可以结合现代前端框架(如 React 或 Vue 等),将这些交互封装成组件,从而提高代码的复用性和维护性。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值