DIV+CSS:CSS样式使用示例;
2012-02-21 14:29
302 查看
<html>
<head>
<title>CSS样式</title>
<style type="text/css">
h1, h2 {
color: blue;
font-style: italic;
}
.WARNING {
font-weight: bold;
font-size: 150%;
margin: 0 1in 0 1in;
background-color: yellow;
border: solid red 8px;
padding: 10px;
}
.WARNING h1, .WARNING h2 {
text-align: center;
}
#paragraph {
text-align: center;
text-transform: uppercase;
}
</style>
</head>
<body>
<h1>Cascading Style Sheets Demo</h1>
<div class="WARNING">
<h2>Warning</h2>
This is a warning!
Notice how it grabs your attention with its bold text and bright colors.
Also notice that the heading is centered and in blue italics.
</div>
<p id="paragraph">
This paragraph is centered<br>
and appears in uppercase letters.<br>
<span style="text-transform: none;">
Hear we explicitly use an inline style to override the uppercase letters.
</span>
</p>
</body>
</html>
<head>
<title>CSS样式</title>
<style type="text/css">
h1, h2 {
color: blue;
font-style: italic;
}
.WARNING {
font-weight: bold;
font-size: 150%;
margin: 0 1in 0 1in;
background-color: yellow;
border: solid red 8px;
padding: 10px;
}
.WARNING h1, .WARNING h2 {
text-align: center;
}
#paragraph {
text-align: center;
text-transform: uppercase;
}
</style>
</head>
<body>
<h1>Cascading Style Sheets Demo</h1>
<div class="WARNING">
<h2>Warning</h2>
This is a warning!
Notice how it grabs your attention with its bold text and bright colors.
Also notice that the heading is centered and in blue italics.
</div>
<p id="paragraph">
This paragraph is centered<br>
and appears in uppercase letters.<br>
<span style="text-transform: none;">
Hear we explicitly use an inline style to override the uppercase letters.
</span>
</p>
</body>
</html>
相关文章推荐
- 使用css实现div垂直居中的示例
- 设置div的背景为半透明,下面有个不错示例,使用div+css来实现下,不会的朋友可以参考下
- 为什么使用css样式和div+css布局标准的优点
- 学会使用css缩写div+css布局代码(使你的代码更加简洁)
- CSS旋转与翻转使用示例详解
- 使用IE8时,DIV+CSS网站不居中的解决方案
- 最使用CSS+DIV学习合集 从零开始
- DIV+CSS左中右布局使用float右边总是掉下去了
- 怎么使用3个div实现这个布局,css怎么写
- CSS+Div布局示例(转)
- 如何使用JS来改变CSS样式 -- 元素的样式属性名称在CSS和JS中的对照表
- css实现文本和div居中对齐详细讲解示例
- DIV+CSS布局入门示例(三)页面顶部制作
- 使用DIV弹出框的代码示例,备忘。
- CSS使用示例
- CSS+DIV网页布局(黄冈网校首页布局)示例代码
- 使用CSS去掉网页中超链接的下划线示例
- 使用如下css可以使div永远保持在屏…
- div style常用属性介绍及使用示例
- jquery ready函数、css函数及text()使用示例