<div class="container">
<h2>实例</h2>
<div class="pull-left">元素浮动到左侧</div>
<div class="pull-right">元素浮动到右侧</div>
</div>

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAABVUAAACPCAIAAAB1ZawGAAAKVklEQVR4nO3dK3PqWgOA4f2florCfaoKh8JVoXAoVFxU/wCqDhWFQ+GiUHEoFA4VxxH0wi0hbT/o3ovnmTV7emgudKarc94kJH92f/4YhmEYhmEYhmEYhhH3+LP782cHAAAAREz/AwAAQPz0PwAAAMRP/wMAAED89D8AAADET/8DAABA/PQ/AAAAxE//AwAAQPz0PwAAAMRP/wMAAED89D8AAADET/8DAABA/PQ/AAAAxE//AwAAQPz0PwAAAMRP/wMAAED89D8AAADET/8DAABA/PQ/AAAAxE///5qqzCezcvvz7Wy31f/h7QAAABAz/f+LqkWaJL3xbP2jrZSTp6Q3zr96JGE5GUwWq58ffgAAAOBfoP9/1XY2DCEkvcny26fwN/kghPCUzjdfW2+ZhRA6o9naxQMAAAAPQP//rqpIkxBCyJbf3MB2Pgoh9Kf11xBU5Wv6Wp5V/jL7yW4BAAD4t+j/m6vKctXw3SJNQvel4fx/48f7q0UaQhjOttsyn7xcMu4nIYRkMF0db0b/AwAAPBL9f3PlZDgtt7U2q6JYbeq+u5qNu8kgrzu7Xy3SEJK0qHa73a7a7g8VbPJBCE+Tsvlt6X8AAIBHov9vbTXtPQ3Si6fmWxj1Qggh1BwCqBbphdIvshCSC2W/yYfPWb58u0+A/gcAAHgk+v+2qmX2dPVcfLWtuQ1/tUiTkPTG0+X60ocAqkV64aP/5eTpYv7vDwyEbrb/rIH+BwAAeCT6/5aqZdYNITx/nrxfTQfDbHbyrL5lFjrPZ6/uduWk158sax/Rt50NQ+hli+M7+K+mvZr83y2zEAa58/8AAAAPSP/fUDnphhBC9+j0//6YQOf59TPsl1kIIXTHs6Mz+dv55PSefUfW0/7+swG9rPg8RrDJByGk848bCqzyQdId56tqp/8BAAAemP6/oWq9LIrl6vQE/ttVAcl4/vadff9/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AA8dP/AAAAED/9DwAAAPHT/wAAABA//Q8AAADx0/8AAAAQP/0PAAAA8dP/AAAAED/9DwAAAPHT/wAAABA//Q8AAADx0/8AAAAQP/0PAAAA8dP/AAAAED/9DwAAAPHT/wAAABA//Q8AAADx0/8AAAAQP/0PAAAA8dP/AAAAED/9DwAAAPHT/wAAABA//Q8AAADx0/8AAAAQP/0PAAAA8dP/AAAAED/9DwAAAPHT/wAAABA//Q8AAADx0/8AAAAQP/0PAAAA8dP/AAAAED/9DwAAAPHT/wAAABA//Q8AAADx0/8AAAAQP/0PAAAA8dP/AAAAED/9DwAAAPHT/wAAABA//Q8AAADx0/8AAAAQP/0PAAAA8Xvrf8MwDMMwDMMwDMMwoh7/ATHGcFwYwts6AAAAAElFTkSuQmCC" alt="" width="1081" height="143" />

.container{margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px;}

.pull-left{float:left !important;}

!important会提升该条规则的优先级,如果有如下2条规则
.pull-left{color:red !important;}
.pull-left{color:green;}
这样pull-left文字的颜色就是红色
如果不加!important就会被第二条的规则覆盖显示为绿色了

05-11 14:03