使用div元素来包含内容
在编写样式表时,经常要用到<div>元素来包含内容~~
下面试简单的示例~
moreHigh.htm
<!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;
}
运行 效果图:


仅作为基本示例~~
使用div元素来包含内容的更多相关文章
- Path,Files巩固,题目:从键盘接收两个文件夹路径,把其中一个文件夹中(包含内容)拷贝到另一个文件夹中
这个题目用传统的File,InputStream可以做,但是如果用Files,Path类做,虽然思路上会困难一些,但是代码简洁了很多,以下是代码: import java.io.IOException ...
- CSS如何让DIV的宽度随内容的变化
[css]CSS如何让DIV的宽度随内容的变化 让div根据内容改变大小 div{ width:auto; display:inline-block !important; display:inlin ...
- 如何遍历div里面的文本内容,用each方法,
如何遍历div里面的文本内容,然后进行匹配传来的数据,进行选中div,并进行CSS样式处理, for(i = 0; i< $(".itemMenuRowBox").child ...
- Header 与 Footer 的 DIV 高度固定, 中间内容 DIV高度自适应,内容不满一页时,默认填满屏幕。
一.需求: 页面布局分三大块: Header Body Footer 1.内容不满一页时,Footer 在屏幕最底部,Body 填充满 Header 与 Footer 中间的部分. 2.当缩小浏览器时 ...
- css固定div头部 滚动条滚动内容
页面布局,固定头部,滚动下方内容 实际场景 在制作页面的时候,经常会遇到要这样的情况:整个页面,整体分三大模块,头部固定,内容区域,左边固定,右边可以滚动. 最终想要的效果 案例源码 <!DOC ...
- div、span绑定内容改变事件
内容改变事件onchange只适用于form表单标签(input.select.textarea) 当需要对div.span标签进行内容改变监听则无法适用,查阅了一些资料发现jquery有针对的方法, ...
- 使用python实现两个文件夹里文件的对比(包含内容的对比)
#-*-coding:utf-8-*- #=============================================================================== ...
- js修改div标签中的内容
<div id='divId'>初始文字</div> <script> $(document).ready(function(e){ $('#divId').htm ...
- HTML-点击Div读取本地文件内容
<!DOCTYPE html> <html> <div id="container" onclick="choosefile();" ...
随机推荐
- 在intellj idea下用sbt的坑
version : SBT 0.13.7 intellij 14 新建SBT项目以后无法编译,总是显示 Can not resolve symble stackoverflow 给出了暂时的解决办法. ...
- C#软件设计——小话设计模式原则之:接口隔离原则ISP
前言:有朋友问我,设计模式原则这些东西在园子里都讨论烂了,一搜一大把的资料,还花这么大力气去整这个干嘛.博主不得不承认,园子里确实很多这方面的文章,并且不乏出色的博文.博主的想法是,既然要完善知识体系 ...
- Windows Iot:让Raspberry Pi跑起来(1)
首先请大家原谅我的"不务正业",放着RabbitHub不写,各种系列的文章不写搞什么Iot,哈哈,最近心血来潮想搞个速度极快的遥控车玩,望着在角落的Raspberry Pi恶狠狠的 ...
- 【Jquery】$.Deferred 对象
源:http://www.ruanyifeng.com/ deferred三个状态 “已完成”“未完成”“已失败” (1) $.Deferred() 生成一个deferred对象. ...
- ubuntu14.04 python3.*连接mysql
先下载pymysql文件,http://webscripts.softpedia.com/script/Database-Tools/PyMySQL-71606.html 我下载的是:PyMySQL- ...
- 篇一:JSON格式转换(一)
JSON.parse()和JSON.stringify()的使用 1.JSON.parse() 用于从一个字符串中解析出json 对象.例如 var str='{"name":&q ...
- net MVC 重定向总结
[HttpPost] public ActionResult StudentList(string StudName, string studName, DateTime BirthDay, Form ...
- jeecg单步调试
自己没本事写开发平台,用别人的又各种担心,想学着别人弄个单步调试,老是出现这个"source not found"-- 百度各种方法都搞不定,担心是自己安装错了?这个jeecg本身 ...
- linux-磁盘空间(du-df)
当磁盘大小超过标准时会有报警提示,这时如果掌握df和du命令是非常明智的选择. df可以查看一级文件夹大小.使用比例.档案系统及其挂入点,但对文件却无能为力. du可以查看文件及文件夹的大小. 简要介 ...
- HTML+CSS知识点总结
转自:http://blog.csdn.net/qiushi_1990/article/details/40260447?utm_source=tuicool&utm_medium=refer ...