手动实现一个ul列表固定在input下方

  • 效果图:
    css div与其他标签的位置设置
  • 代码:
     	<td class="td_right" style="width:120px;position:relative">
      	<input type="text" name="areaTree" onclick="selectAreaFunc()" id="areaTree3" class="input_text" />
           <div  id="sidebar" class="sidebar" style="width: 130px;background-color: white;position: absolute;top: 25px;z-index: 99999;display: none">
                     <ul id="smpltree_box" class="ztree treeDiv" style="height: 300px;width: 100%;overflow:auto;"></ul>
            </div>
       </td>
    
    • 给父级设置:·position:relative
    • div设置:·position: absolute,然后设置位置topleft

相关文章: