📄 html_attributes.asp@output=print
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-US" xml:lang="en-US" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>HTML Attributes</title>
<link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" />
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<meta name="Keywords" content="xml,tutorial,html,dhtml,css,xsl,xhtml,javascript,asp,ado,vbscript,dom,sql,colors,soap,php,authoring,programming,training,learning,beginner's guide,primer,lessons,school,howto,reference,examples,samples,source code,tags,demos,tips,links,FAQ,tag list,forms,frames,color table,w3c,cascading style sheets,active server pages,dynamic html,internet,database,development,Web building,Webmaster,html guide" />
<meta name="Description" content="Free HTML XHTML CSS JavaScript DHTML XML DOM XSL XSLT RSS AJAX ASP ADO PHP SQL tutorials, references, examples for web building." />
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="cache-control" content="no-cache" />
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "../../https@ssl./default.htm" : "../../www./default.htm");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-3855518-1");
pageTracker._initData();
pageTracker._trackPageview();
</script>
</head>
<body>
<p>From <b>http://www.w3schools.com</b> (Copyright Refsnes Data)</p>
<h1>HTML Attributes</h1>
<a href="html_primary.asp"><img border="0" src="../images/btn_previous.gif" width="100" height="20" alt="Previous" /></a>
<a href="html_formatting.asp"><img border="0" src="../images/btn_next.gif" alt="Next" width="100" height="20" /></a>
<hr />
<p class="intro">Attributes provide additional information
to an HTML element.</p>
<hr />
<h2>HTML Tag Attributes</h2>
HTML tags can have attributes<i>. </i>Attributes provide additional information
to an HTML element.<p>Attributes always come in name/value pairs like this: name="value".</p>
<p>Attributes are always specified in the start tag of an HTML element.</p>
<hr />
<h2><b>Attributes Example 1:</b></h2>
<p><h1> defines the start of a heading. </p>
<p><h1 align="center"> has additional information about the alignment.</p>
<p><a target="_blank" href="tryit.asp@filename=tryhtml_header">Try it yourself:
Center aligned heading</a></p>
<hr />
<h2><b>Attributes Example 2:</b></h2>
<p><body> defines the body of an HTML document. </p>
<p><body bgcolor="yellow"> has additional information about the background
color.</p>
<p><a target="_blank" href="tryit.asp@filename=tryhtml_bodybgcol">Try it
yourself: Background color</a></p>
<hr />
<h2><b>Attributes Example 3:</b></h2>
<p><table> defines an HTML table. (You will learn more about HTML tables
later)</p>
<p><table border="1"> has additional information about the border around
the table. </p>
<hr />
<h2>Use Lowercase Attributes</h2>
<p>Attributes and attribute values are case-insensitive. However, the World Wide Web Consortium (W3C) recommends lowercase
attributes/attribute values in
their HTML 4 recommendation, and XHTML demands
lowercase attributes/attribute values.</p>
<hr />
<h2>Always Quote Attribute Values</h2>
<p>Attribute values should always be enclosed in quotes. Double style quotes are the most common,
but single style quotes are also allowed.</p>
<p>In some rare situations, like when the attribute value itself contains
quotes, it is necessary to use single quotes:</p>
<p>name='John "ShotGun" Nelson'</p>
<hr />
<a href="html_elements.asp"><img border="0" src="../images/btn_previous.gif" width="100" height="20" alt="Previous" /></a>
<a href="html_formatting.asp"><img border="0" src="../images/btn_next.gif" width="100" height="20" alt="Next" /></a>
<p>From <b>http://www.w3schools.com</b> (Copyright Refsnes Data)</p>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -