#votingmeter { wIDth:25em; height:20em; background-color:black;} .Voteindex { wIDth:2em; height:8em; background-color:yellow; float:left; position:absolute; bottom:0; margin:2em;}
<div ID="votingmeter"> <div ></div> <div ></div> <div ></div> <div ></div></div>
(请参阅.votingindex)
但问题是.votingindex元素是重叠的.我希望在每个div元素之间应用一些空格.
任何人都可以建议我这样做吗?
另外,我希望黄色div(.Voteindex)保持在黑色div(#votingmeter)内.
解决方法 包裹.Voteindex div在div中的位置绝对.#votingmeter { wIDth:25em;height:20em;background-color:black; position: relative; } .Voteindex { wIDth:2em;height:8em; background-color:yellow;float:left; margin:2em;} .bottom { position:absolute;bottom:0; }
<body><div ID="votingmeter"> <div > <div ></div> <div ></div> <div ></div> <div ></div> </div></div> </body>总结
以上是内存溢出为你收集整理的html – 如何在绝对定位元素之间应用水平空间全部内容,希望文章能够帮你解决html – 如何在绝对定位元素之间应用水平空间所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)