html bootstrap 部分实用代码

2016年11月2日 0 条评论 1.64k 次阅读 0 人点赞

div居中

对body设置text-align:center,再对需要居中的div盒子设置css样式margin:0 auto,这样即可让对应div水平居中。

<!DOCTYPE html> 
<html> 
<head> 
<meta charset="utf-8" /> 
<title>div居中 在线演示 www.divcss5.com</title> 
<style> 
body{ text-align:center} 
.div{ margin:0 auto; width:400px; height:100px; border:1px solid #F00} 
/* css注释:为了观察效果设置宽度 边框 高度等样式 */ 
</style> 
</head> 
<body> 
<div class="div"> 
DIVCSS5实例 
</div> 
</body> 
</html> 

bootstrap响应式图片自适应图片大小

<img src="..." class="img-responsive center-block" >

css中的FLOAT是对齐方式

1、LEFT是左对齐;
2、RIGHT是右对齐;
3、CENTER是居中;
4、NONE就是取消对齐方式;

css向下自适应

display:-moz-inline-box;  display:inline-block;

css边界为圆角

border-radius:4px;

css行中位置

line-height:38px;

css边框

padding:3px;border:1px solid #ddd;

Sevenfal

这个人太懒什么东西都没留下

文章评论(0)