使用div元素来包含内容

在编写样式表时,经常要用到<div>元素来包含内容~~

下面试简单的示例~

moreHigh.htm
l
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>More High</title>
	<link rel="stylesheet" type="text/css" href="css/moreHigh.css">
</head>
<body>
	<div>
		<p>Here are two paragraph of content.</p>
		<p>In a div containter.</p>
		<h1>more choose sign..</h1>
		<h2>same font-family but different font-size..</h2>
		<h3>use h3 and h4 with the same class</h3>
		<h4>use h4 the same class ...</h4>
	</div>
	<h1>Less choose outside the div...</h1>

	<div class="content">
	<p>up and down to choose</p>
	<h1>and it is clear...</h1>
	<h2>This h2 is in the content not the first h2..</h2>
	<p><span class="LeadIn">this is in the content class of the LeadIn class in the content class<br></span>you're probably feeling pretty good.<br>
	afte all, life in the development world is comfortable....</p>
	</div>
 <p>class 在css中用句点.    ID在css中用#</p>
 <h1>Id 选择符非常适合于一个页面中唯一的、不会重复的元素应用样式</h1>

 <div id="Menu">This time use id to creat the css style..
 <h1>and in this css use #Menu to express..</h1>
 <p>I like it very much</p>
 </div>

<a class="BackwardLink" href="WWW.baidu.com">It is a virtual class</a>
<a class="Link" href="WWW.BaiDu.com">WWW.BaiDu.com</a>
<a href="www.baidu.com">back</a>
<br><br>

<label for="name">Name:</label><input id="name" type="text"><br>
<input type="submit" value="OK">


</body>
</html>

moreHigh.css

@charset "utf-8";

div {
	font-size: 34px;
	background: #B7C6CE;
	border: 0 25px 0;
}
h1 {
	font-family: Impact, Charcoal, sans-serif;
	font-size: 34px;
	color: #5DBA30;
}
h2 {
	font-family: Impact, Charcoal, sans-serif;
	font-size: 20px;
	color: #57B7F4;
}
h3, h4 {
	font-family: Impact, Charcoal, sans-serif;
	font-size: 15px;
	color: #E6E6E6;
}
h3 {
	background: #178716;
}
h4 {
	background: #0C1021;
}
.content p {
	font-size: 20px;
	color: #90C02D;
}
.content h1, h2 {
	background: #F4AC25;
	color: #000000;
}
.centent.LeadIn {
	font-size: 45px;
	color: #0C1021;
}
#Menu {
	font-size: 45px;
	background: #C0ADBB;
	color: #E7FF79;
}
.BackwardLink:link {
	color: red;
}
.BackwardLink:visited {
	color: blue;
}
.Link:link {
	color: green;
}
.Link:visited{
	color: blue;
}
input[type="text"] {
	background-color: silver;
}
label[for="name"] {
	width: 200px;
	color: blue;
	font-size: 24px;
	font-family: Impact, Charcoal, sans-serif;
}

 

运行 效果图:

仅作为基本示例~~

 

转载于:https://www.cnblogs.com/haixiaomei/p/5017952.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值