在编写样式表时,经常要用到<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;
}

运行 效果图:

仅作为基本示例~~

使用div元素来包含内容的更多相关文章

  1. Path,Files巩固,题目:从键盘接收两个文件夹路径,把其中一个文件夹中(包含内容)拷贝到另一个文件夹中

    这个题目用传统的File,InputStream可以做,但是如果用Files,Path类做,虽然思路上会困难一些,但是代码简洁了很多,以下是代码: import java.io.IOException ...

  2. CSS如何让DIV的宽度随内容的变化

    [css]CSS如何让DIV的宽度随内容的变化 让div根据内容改变大小 div{ width:auto; display:inline-block !important; display:inlin ...

  3. 如何遍历div里面的文本内容,用each方法,

    如何遍历div里面的文本内容,然后进行匹配传来的数据,进行选中div,并进行CSS样式处理, for(i = 0; i< $(".itemMenuRowBox").child ...

  4. Header 与 Footer 的 DIV 高度固定, 中间内容 DIV高度自适应,内容不满一页时,默认填满屏幕。

    一.需求: 页面布局分三大块: Header Body Footer 1.内容不满一页时,Footer 在屏幕最底部,Body 填充满 Header 与 Footer 中间的部分. 2.当缩小浏览器时 ...

  5. css固定div头部 滚动条滚动内容

    页面布局,固定头部,滚动下方内容 实际场景 在制作页面的时候,经常会遇到要这样的情况:整个页面,整体分三大模块,头部固定,内容区域,左边固定,右边可以滚动. 最终想要的效果 案例源码 <!DOC ...

  6. div、span绑定内容改变事件

    内容改变事件onchange只适用于form表单标签(input.select.textarea) 当需要对div.span标签进行内容改变监听则无法适用,查阅了一些资料发现jquery有针对的方法, ...

  7. 使用python实现两个文件夹里文件的对比(包含内容的对比)

    #-*-coding:utf-8-*- #=============================================================================== ...

  8. js修改div标签中的内容

    <div id='divId'>初始文字</div> <script> $(document).ready(function(e){ $('#divId').htm ...

  9. HTML-点击Div读取本地文件内容

    <!DOCTYPE html> <html> <div id="container" onclick="choosefile();" ...

随机推荐

  1. 【跟着子迟品 underscore】JavaScript 数组展开以及重要的内部方法 flatten

    Why underscore (觉得这一段眼熟的童鞋可以直接跳到正文了...) 最近开始看 underscore.js 源码,并将 underscore.js 源码解读 放在了我的 2016 计划中. ...

  2. VMware Workstation中网络连接之桥接、NAT和Host-only

    在Windows XP系统中,安装好VMware Workstation虚拟机软件以后,我们可以查看一下"网络连接"窗口: 在窗口中多出了两块网卡: VMware Network ...

  3. Ubuntu 14.04.1 建立 Android M, Android N 開發環境 與 問題

    # Modify /etc/apt/sources.list# add below 3 lines to /etc/apt/sources.listdeb http://archive.ubuntu. ...

  4. logback 配置详解

    一:根节点<configuration>包含的属性: scan: 当此属性设置为true时,配置文件如果发生改变,将会被重新加载,默认值为true. scanPeriod: 设置监测配置文 ...

  5. LVS持久连接

    LVS持久连接 源地址HASH ipvs的连接模板 可以通过ipvsadm -L -c 持久连接持久客户端连接 PCC:在固定时间内将来自于同一个客户端发往VIP的所有请求统统定向至同一个RS0表示所 ...

  6. js鼠标事件大全

    一般事件 事件 浏览器支持 描述 onClick HTML: 2 | 3 | 3.2 | 4 Browser: IE3 | N2 | O3 鼠标点击事件,多用在某个对象控制的范围内的鼠标点击 onDb ...

  7. Uninstall from GAC In C# code

    How do I uninstall the GAC from my C# application. I am not able to uninstall, the particular exe an ...

  8. js打开新页面与关闭当前页面

    打开新的窗口window.open("help.html"); window.open("help.html"); 关闭页面<a href="j ...

  9. 更新/替换系统 hosts,轻松访问国外站点

    更新 hosts 下面介绍的操作均可能覆盖现有 hosts ,进行操作前请先确认是否需要备份. 推荐使用本项目的 Host Tools 来自动化 备份/配置 工作. 若更新 hosts 未立即生效,请 ...

  10. Codeforces Round #374 (Div. 2)

    A题和B题是一如既往的签到题. C题是一道拓扑序dp题,题意是给定一个DAG,问你从1号点走到n号点,在长度不超过T的情况下,要求经过的点数最多,换个思维,设dp[i][j]表示到i号点时经过j个点的 ...