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

精通 CSS+DIV 网页样式与布局 40

2016-12-03 11:20 627 查看
<head>

<title>CSS 选择器的嵌套声明</title>

<style type=”text/css”>

<!–

p b{ /* 嵌套声明 */

color:maroon; /* 颜色 */

text-decoration:underline; /* 下划线 */

}

–>

</style>

</head>

<body>

<p>嵌套使<b>用 CSS</b>标记的方法</p>

嵌套之外的<b>标记</b>不生效

</body>

</html>

CSS 样式的父子关系

<html>

<head>

<title>父子关系</title>

<base target=”_blank”>

<style>

<!–

h1{

color:red; /* 颜色 */

text-decoration:underline; /* 下划线 */

}

h1 em{ /* 嵌套选择器 */

color:#004400; /* 颜色 */

font-size:40px; /* 字体大小 */

}

–>

</style>

</head>

<body>

<h1>祖国的首都<em>北京</em></h1>

<p>欢迎来到祖国的首都<em>北京</em>,这里是全国<strong>政治、<a

href=”economic.html”><em>经济</em></a>、文化</strong>的中心</p>

<ul>

<li>在这里,你可以:

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