简体   繁体   English

带jQuery进度栏的CSS树文件夹列表

[英]css tree folders list with jquery progress bar

I have a tree of folders and I want to add a progress bar next to the folder name which is also an anchor. 我有一棵文件夹树,我想在文件夹名称旁边添加一个进度条,这也是一个锚点。 The progress bar div section is the jQuery UI progress bar div. 进度条div部分是jQuery UI进度条div。

The pblabel element should seat on top of the progress bar. pblabel元素应位于进度栏的顶部。 The bar element is the progress bar itself with a variable width. bar元素是进度栏本身,宽度可变。

<ul>
  <li>
    <a href="" style="display: inline;">test</a>
    <div id="progressbar" style="display: inline; height: 2em; background: white;">
      <div id="pblabel" style="position: absolute">progress</div>
      <div id="bar" style="display: inline; background: blue; width: 30%; height: 100%;></div>
    </div>
  </li>
</ul>

I can see the anchor element fine with the pblabel element next to it. 我可以看到锚元素很好,旁边有pblabel元素。 I don't see the blue bar element or the white background of the progressbar element. 我没有看到蓝色的bar元素或progressbar元素的白色背景。

<div id="bar" style="display: inline; background: blue; width: 30%; height: 100%;></div>

This line is missing a " before the > . Besides that the reason you are not seeing the blue bar is that it has a width of 30% and is inline (and it is also empty). inline means that it will use as few space as possible; for that reason a width is meaningless for inline elements. 该行在>之前缺少" 。”除此之外,您看不到蓝色条的原因是它的宽度为30%, 并且inline (并且也是空的) inline表示将使用较少的空间尽可能;由于这个原因, inline元素的width没有意义。

Since the div is empty (there is nothing inside) and is inline its width will be 0 and you won't see it. 由于div是空的(内部没有任何内容)并且是内联的,因此其宽度将为0,而您将看不到它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM