css |
您所在的位置:网站首页 › html向右浮动代码 › css |
让页面的DIV布局向左或者向右有两种方法:
一:为了防止float,min-height等具有浮动效果的代码影响上下的div样式布局,可以要加上一个空白的div,其css属性为clear: 其 css要用 :.clear { clear: both; }
实例: html代码:
css代码:
.img, .con, .school, .amount, .type, .count { float: lefet; }
========================================================================================
二:如果不想用 clear 就不用 float:right 属性,可以用: text-align: right; 但是这个要求外围要套多个div进行块元素的扩展,让之能够正确的让div靠左或靠右。
ฅ՞•ﻌ•՞ฅ ~ 厚着脸皮要个赞赏哈 ~ ฅ՞•ﻌ•՞ฅ |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |