我想在 div
的边框上放置一个小的圆形登录图像,这样半个图像将在边界线之外只是为了样式目的?我想我必须设置 z-index 但如何或者有更好的方法吗?
最佳答案
这正是您需要做的。
给你img一个类名。然后在你的样式表中添加这样的东西
#classname
{
position: absolute;
z-index: 10;
top: #distance from top of page#
left: #distance from left of page#
}
z-index 需要是一个大于你的 div 的数字,如果你没有改变它,它的索引将为 0。
希望这对您有所帮助。
关于html - 如何在div上叠加图像?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3382004/