首页 > 代码库 > html_div笔记

html_div笔记

    div 画糖葫芦效果:

关键的属性:position:absolute;

<div id="container" style="width:500px">
        <div style="position:absolute; left:30px; top:50px; background:#F00; width:1px; height:200px">
        </div>
        <div style="position:absolute; left:20px;top:80px;  background:#FF0; width:20px;height:20px;border-radius:100px; border:1px solid #808080; text-align:center; float:left; ">
            1
        </div>
        <div style="position:absolute; left:20px;top:120px;  background:#FF0; width:20px;height:20px;border-radius:100px; border:1px solid #808080; text-align:center; float:left; ">
            2
        </div>
        <div style="position:absolute; left:20px;top:160px;  background:#FF0; width:20px;height:20px;border-radius:100px; border:1px solid #808080; text-align:center; float:left; ">
            3
        </div>
        <div style="position:absolute; left:20px;top:200px;  background:#FF0; width:20px;height:20px;border-radius:100px; border:1px solid #808080; text-align:center; float:left; ">
            4
        </div>
    </div>