您的位置:首页 > Web前端 > CSS

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>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: