margin叠加相邻两个元素的上下margin是叠加在一起
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
<style>
#box{width:200px;height:200px;background:Red;border:10px solid #000; margin:30px 100px 100px}
#div{width:200px;height:200px;background:blue;border:10px solid #ccc; margin:40px;}
/*
margin 外边距(margin元素的边框之外不显示元素背景)
margin:10px 20px;上 左
margin:10px 20px 40px;上 左下
margin:10px 20px 40px 60px;上 右 下 左
margin-top
margin-right
margin-bottom
margin-left
margin叠加相邻两个元素的上下margin是叠加在一起
*/
</style>
</head>
<body>
<div id="box"></div>
<div id="div"></div>
</body>
</html>
margin叠加相邻两个元素的上下margin是叠加在一起的更多相关文章
- 给定一个数组,求如果排序后,相邻两个元素的最大差值,要求时间复杂度为O(N)
第一种方法: 计数排序后,然后找出两两之间的最大差值 计数排序的时间复杂度是O(N) public class CountSort { public static void main(String[] ...
- C语言:计算输出给定数组中每相邻两个元素的平均值的平方根之和。
//计算输出给定数组中每相邻两个元素的平均值的平方根之和. #include <stdio.h> #include <math.h> ]) { double a,b,s=0.0 ...
- scala实现相邻两个元素挑换位置的代码,哈哈
import scala.math._ import breeze.plot._ import breeze.linalg._ import scala.collection.mutable.Arra ...
- margin的两个有趣现象:margin合并和margin塌陷
margin合并 当两个元素在垂直方向并列,分别设置margin值时会发生一个margin合并的现象 举个例子,有两个div,垂直并列,box1设置margin-bottom:20px,box2设置m ...
- 行内元素的上下margin 和 img元素的上下margin
行内元素的特点有: 1.与其他元素在同一行 2.宽度(width).高度(height).内边距的top/bottom(padding-top/padding-bottom)和外边距的top/bott ...
- 深入学习CSS外边距margin(重叠效果,margin传递效果,margin:auto实现块级元素水平垂直居中效果)
前言 margin是盒模型几个属性中一个非常特殊的属性.简单举几个例子:只有margin不显示当前元素背景,只有margin可以设置为负值,margin和宽高支持auto,以及margin具有非常奇怪 ...
- [转]如何解决外边距margin叠加的问题探讨
两个或多个毗邻的普通流中的块元素垂直方向上的 margin 会折叠,那么如何使元素上下margin不折叠呢?下面的方法或许对大家有所帮助 一.首先你要知道什么情况下会触发:两个或多个毗邻的普通流中的块 ...
- css将两个元素水平对齐,兼容IE8
css实现元素水平对齐 css实现水平对齐,如图 有人会说css实现这种水平对齐要兼容ie8还不简单吗?使用float: left,或者display: inline-block,不就可以了吗?是的, ...
- Set集合对象比较两个元素的方法
Set集合对象比较两个元素的方法并不是根据“equals()”方法的返回值来比较.而是用“hashCode()”方法来进行判断.只要两个元素的“hashCode()”方法的返回值相同,就认为两个元素相 ...
随机推荐
- [ An Ac a Day ^_^ ] FZU 2030 括号问题 搜索
FZU一直交不上去 先写在这吧 #include<stdio.h> #include<iostream> #include<algorithm> #include& ...
- poj 3524 Charm Bracelet(01背包)
Description Bessie has gone to the mall's jewelry store and spies a charm bracelet. Of course, she'd ...
- 关于Mongdb的java的CRUD操作
package mongodb; import java.net.UnknownHostException;import java.util.List; import com.mongodb.Basi ...
- erlang ets表
一.表遍历 通过ets:first/1获取表的第一个关键字,表中下一个关键字用ets:next/2得到,直到ets:next/2返回'$end_of_table' 当多几个进程并发访问ets表时,可以 ...
- C++ socket programming in Linux
Server.c #include <arpa/inet.h> #include <errno.h> #include <netinet/in.h> #includ ...
- GetWindowRect和GetClientRect的异同
由于项目需要,需要学习CGridCtrl控件的使用,测试控件时发现了一个问题,我无法将控件放在对话框的制定位置. 该问题的原因很容易发现,其实就是GetWindowRec()函数和GetClientR ...
- mave 安装本地jar包到maven库
Maven 安装 JAR 包的命令是: mvn install:install-file -Dfile=本地jar包的位置 -DgroupId=groupId -DartifactId=artifac ...
- Chapter 2 Open Book——15
The rest of the week was uneventful. I got used to the routine of my classes. 这周剩下的时间都是平淡无事的.我就是正常的上 ...
- Eclipse配置--智能补全
定位到:Windows→Preferences→Java→Editor→Content Assist 将Auto Activation triggers for java的默认值“.”修改为" ...
- JqGrid动态改变列名
setLabel colname, data, class, properties jqGrid对象 给指定列设置一个新的显示名称.colname:列名称,也可以是列的位置索引,从0开始:data:列 ...