问题描述
我正在寻找在HTML文件中自定义位置div的最佳策略吗?
试图将仪表板与图形和其他输入组合在一起,但是我正在寻找这些视觉效果可自定义放置在中心图像周围。到目前为止,我已经能够将它们放置在预定的网格内。
提前谢谢
解决方法
我不是这种样式的忠实拥护者,但是您可以尝试以下方法:
.div1{ //the class of your div
postion: absolute;
top: 25%; //this is the margin percentage from the top
left: 60%; //this is the margin percentage from the left
z-index: 10;
}
这不是真正可靠的解决方案,但是它将div放置在页面上相对于顶部和左侧的任何位置。