网摘 |  收藏 | 
摘要: 定义和用法<style> 标签用于为 HTML 文档定义样式信息。在 style 中,您可以规定在浏览器中如何呈现 HTML 文档。type 属性是必需的,定义 style 元素的内容。唯一可能的值是 "text/css"。style 元素位于 head 部分中。实例<html><head><style type="text/css">h1 {color:red}p {color:blue}</style></head><body><h1>Header 1&l 阅读全文
posted @ 2012-11-22 17:44 xulonghua219 阅读(221) 评论(0) 推荐(0) 编辑
摘要: 转自 http://www.w3school.com.cn/css/css_syntax_class_selector.asp在 CSS 中,类选择器以一个点号显示:.center {text-align: center}在上面的例子中,所有拥有 center 类的 HTML 元素均为居中。在下面的 HTML 代码中,h1 和 p 元素都有 center 类。这意味着两者都将遵守 ".center" 选择器中的规则。<h1 class="center">This heading will be center-aligned</h1> 阅读全文
posted @ 2012-11-22 17:39 xulonghua219 阅读(119) 评论(0) 推荐(0) 编辑