如何实现多个div水平均匀排列且量两端贴壁
<!DOCTYPE html>
<html>
<head>
<meta charset=" utf-8">
<meta name="author" content="http://www.51texiao.cn/" />
<title>蚂蚁部落</title>
<style type="text/css">
.parent{
width:480px;
height:100px;
border:1px solid red;
overflow:hidden;
}
.parent div{
width:100px;
height:100px;
background-color:green;
margin-left:20px;
float:left;
}
</style>
</head>
<body>
<div class="parent">
<div></div>
<div></div>
<div></div>
<div></div>
</div>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta charset=" utf-8">
<meta name="author" content="http://www.51texiao.cn/" />
<title>蚂蚁部落</title>
<style type="text/css">
.parent{
width:460px;
height:100px;
border:1px solid red;
overflow:hidden;
}
.wrap{
width:480px;
height:100px;
overflow:hidden
}
.parent .wrap div{
width:100px;
height:100px;
background-color:green;
margin-right:20px;
float:right;
}
</style>
</head>
<body>
<div class="parent">
<div class="wrap">
<div></div>
<div></div>
<div></div>
<div></div>
</div>
</div>
</body>
</html>
如何实现多个div水平均匀排列且量两端贴壁的更多相关文章
- 元素均匀排列自动换行&二维数组前端遍历
1.元素均匀排列并自动换行 display:flex; flex-wrap:wrap; 2.getFiled();取一行,取多行的话用getFiled(‘id’,true); 3.二维数组前端遍历: ...
- CSS实现DIV水平自适应居中
DIV水平自适应居中 <!DOCTYPE html> <html lang="cn"> <head> <meta charset=&quo ...
- 让DIV水平和垂直居中的几种方法
我们在设计页面的时候,经常要把DIV居中显示,而且是相对页面窗口水平和垂直方向居中显示,如让登录窗口居中显示.我们传统解决的办法是用纯CSS来让DIV居中.在本文中,我将给大家讲述如何用CSS和jQu ...
- 如何让div水平垂直居中
引子 我们经常遇到需要把div中的内容进行水平和垂直居中.所以,这里介绍一种方法,可以使div水平居中和垂直居中. 代码: <!DOCTYPE html> <html lang=&q ...
- 【转】如何让DIV水平和垂直居中
来源:http://blog.163.com/www.wxs_123/blog/static/82784664201321831746921/ 我们在设计页面的时候,经常要把DIV居中显示,而且是相对 ...
- 文字以及div水平垂直居中
文字以及div水平垂直居中.md <div class=”content”> <div class=”mydiv”> huangyingnin! </div>< ...
- 【笔记】让DIV水平垂直居中的两种方法
今天写的了百度前端学院春季班的任务:定位和居中问题 由于距离上次学习CSS有点久远了,加上以前木有记笔记的习惯,方法忘得只剩下一种,今天通过网上查阅资料总结了以下两种简单的方法让DIV水平垂直居中. ...
- DIV水平和垂直居中的实现
在div的宽度和高度固定的情况下,实现div水平和垂直居中普遍采用如下的方式: <!DOCTYPE html> <html> <head> <style ty ...
- CSS:使用CSS3将一个div水平和垂直居中显示
使用css3将一个div水平和垂直居中显示 方案一: div绝对定位水平垂直居中[margin:auto实现绝对定位元素的居中], 代码两个关键点:1.上下左右均0位置定位: 2.margin: au ...
随机推荐
- 论文笔记之:Deep Reinforcement Learning with Double Q-learning
Deep Reinforcement Learning with Double Q-learning Google DeepMind Abstract 主流的 Q-learning 算法过高的估计在特 ...
- Share Point 创建 TimerJob
public class SyncMetadataJob:SPJobDefinition { private const string JobName = @"Metadata Sync J ...
- CSS3弹性盒模型之box-flex
对于之前讲过的box-sizing属性,对于页面布局很有用,但是突然发现它依然存在一些问题,前面例子中不会存在问题,不代表它没有问题.如果元素的个数整除100%的时候呢,比较3个元素,那么第一个盒子的 ...
- mysql 多行合并一列
mysql 多行合并一列 使用的函数为: GROUP_CONCAT(exp) 其中exp 的参数类似如下: (field order by field desc separator ';') ...
- TKinter事件及绑定
Windows编程是基于消息的,绝大多数界面编程是基于事件的. 事件的绑定函数bind: 语法 :窗体对象.bind(事件类型,回调函数) 所谓的"回调函数",就是这个函数我们不用 ...
- AngularJS_对象数组-filter-orderBy
<!doctype html> <html> <head> <meta charset="utf-8"> <title> ...
- 解决:mvn archetype:create Abstract class or interface 'org.apache.maven.artifact.repository.ArtifactRepository' cannot be instantiated
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2 .3:create (default- ...
- Zabbix 教程
Zabbix 教程http://blog.csdn.net/linuxlsq/article/details/52606086 MySQL在以下几种情况会创建临时表:1.UNION查询:2.用到TEM ...
- Android 使用AIDL调用外部服务
好处:多个应用程序之间建立共同的服务机制,通过AIDL在不同应用程序之间达到数据的共享和数据相互操作, 本文包括: 1 .创建AIDL 服务端.2 .创建AIDL 客户端. 3.客户端调用服务端提供的 ...
- javascript 容错
window.onerror=function(){ return true;} 系统有onerror报错的代码,只要重新一下就可以在javascript错误的时候返回真(true)