html入门教程7
1、HTML 背景HTML 内联框架HTML 颜色好的背景使站点看上去特别棒。实例搭配良好的背景和颜色一个背景颜色和文字颜色搭配良好的例子,使页面中的文字易于阅读。搭配得不好的背景和颜色一个背景颜色和文字颜色搭配得不好的例子,使页面中的文字难于阅读。(可以在本页底端找到更多实例。)背景(Backgrounds)<body> 拥有两个配置背景的标签。背景可以是颜色或者图像。背景颜色(Bgcolor)背景颜色属性将背景设置为某种颜色。属性值可以是十六进制数、RGB 值或颜色名。<body bgcolor="#000000"> <body bgcolor="rgb(0,0,0)"> <body bgcolor="black">以上的代码均将背景颜色设置为黑色。背景(Background)背景属性将背景设置为图像。属性值为图像的URL。如果图像尺寸小于浏览器窗口,那么图像将在整个浏览器窗口进行复制。<body background="clouds.gif"> <body background="http://www.w3school.com.cn/clouds.gif">URL可以是相对地址,如第一行代码。也可以使绝对地址,如第二行代码。提示:如果你打算使用背景图片,你需要紧记一下几点:背景图像是否增加了页面的加载时间。小贴士:图像文件不应超过 10k。背景图像是否与页面中的其他图象搭配良好。背景图像是否与页面中的文字颜色搭配良好。图像在页面中平铺后,看上去还可以吗?对文字的注意力被背景图像喧宾夺主了吗?基本的注意事项 - 有用的提示:<body> 标签中的背景颜色(bgcolor)、背景(background)和文本(text)属性在最新的 HTML 标准(HTML4 和 XHTML)中已被废弃。W3C 在他们的推荐标准中已删除这些属性。应该使用层叠样式表(CSS)来定义 HTML 元素的布局和显示属性。更多实例可用性强的背景图像背景图像和文字颜色使页面文本易于阅读的例子。可用性强的背景图像 2另一个背景图像和文字颜色使页面文本易于阅读的例子。可用性差的背景图像背景图像和文字颜色使页面文本不易阅读的例子。
2、HTML 颜色HTML 背景HTML 颜色名颜色由红色、绿色、蓝色混合而成。颜色值颜色由一个十六进制符号来定义,这个符号由红色、绿色和蓝色的值组成(RGB)。每种颜色的最小值是0(十六进制:#00)。最大值是255(十六进制:#FF)。这个表格给出了由三种颜色混合而成的具体效果:ColorColor HEXColor RGB#000000rgb(0,0,0)#FF0000rgb(255,0,0)#00FF00rgb(0,255,0)#0000FFrgb(0,0,255)#FFFF00rgb(255,255,0)#00FFFFrgb(0,255,255)#FF00FFrgb(255,0,255)#C0C0C0rgb(192,192,192)#FFFFFFrgb(255,255,255)颜色名大多数的浏览器都支持颜色名集合。提示:仅仅有 16 种颜色名被 W3C 的 HTML4.0 标准所支持。它们是:aqua, black, blue, fuchsia, gray, green, lime, maroon, navy, olive, purple, red, silver, teal, white, yellow。如果需要使用其它的颜色,需要使用十六进制的颜色值。ColorColor HEXColor Name#F0F8FFAliceBlue#FAEBD7AntiqueWhite#7FFFD4Aquamarine#000000Black#0000FFBlue#8A2BE2BlueViolet#A52A2ABrownWeb安全色数年以前,当大多数计算机仅支持 256 种颜色的时候,一系列 216 种 Web 安全色作为 Web 标准被建议使用。其中的原因是,微软和 Mac 操作系统使用了 40 种不同的保留的固定系统颜色(双方大约各使用 20 种)。我们不确定如今这么做的意义有多大,因为越来越多的计算机有能力处理数百万种颜色,不过做选择还是你自己。216 跨平台色最初,216 跨平台 web 安全色被用来确保:当计算机使用 256 色调色板时,所有的计算机能够正确地显示所有的颜色。
3、HTML 颜色名HTML 颜色HTML 速查手册本页提供了被大多数浏览器支持的颜色名。提示:仅有 16 种颜色名被 W3C 的 HTML 4.0 标准支持,它们是:aqua、black、blue、fuchsia、gray、green、lime、maroon、navy、olive、purple、red、silver、teal、white、yellow。如果使用其它颜色的话,就应该使用十六进制的颜色值。颜色名列表单击一个颜色名或者 16 进制值,就可以查看与不同文字颜色搭配的背景颜色。颜色名十六进制颜色值颜色
4、HTML 4.01 快速参考HTML 颜色名HTM雉搽妤粲L 文档类型来自 W3School 的 HTML 快速参考。可以打印它,以备日常使用。HTML Basi艘早祓胂c Document<html> <head> <title>Document name goes here</title> </head> <body> Visible text goes here </body> </html>Text Elements<p>This is a paragraph</p> <br> (line break) <hr> (horizontal rule) <pre>This text is preformatted</pre>Logical Styles<em>This text is emphasized</em> <strong>This text is strong</strong> <code>This is some computer code</code>Physical Styles<b>This text is bold</b> <i>This text is italic</i>Links, Anchors, and Image Elements<a href="http://www.example.com/">This is a Link</a> <a href="http://www.example.com/"><img src="URL" alt="Alternate Text"></a> <a href="mailto:webmaster@example.com">Send e-mail</a>A named anchor: <a name="tips">Useful Tips Section</a> <a href="#tips">Jump to the Useful Tips Section</a>Unordered list<ul> <li>First item</li> <li>Next item</li> </ul>Ordered list<ol> <li>First item</li> <li>Next item</li> </ol>Definition list<dl> <dt>First term</dt> <dd>Definition</dd> <dt>Next term</dt> <dd>Definition</dd> </dl>Tables<table border="1"> <tr> <th>someheader</th> <th>someheader</th> </tr> <tr> <td>sometext</td> <td>sometext</td> </tr> </table>Frames<frameset cols="25%,75%"> <frame src="page1.htm"> <frame src="page2.htm"> </frameset>Forms<form action="http://www.example.com/test.asp" method="post/get"> <input type="text" name="lastname" value="Nixon" size="30" maxlength="50"> <input type="password"> <input type="checkbox" checked="checked"> <input type="radio" checked="checked"> <input type="submit"> <input type="reset"> <input type="hidden"> <select> <option>Apples <option selected>Bananas <option>Cherries </select> <textarea name="Comment" rows="60" cols="20"></textarea> </form>Entities< is the same as < > is the same as > © is the same as ©Other Elements<!-- This is a comment --> <blockquote> Text quoted from some source. </blockquote> <address> Address 1<br> Address 2<br> City<br> </address>Source : http://www.w3school.com.cn/html/html_quick.asp