html中一个div层在另外一个div或者img上显示

本文探讨了如何在HTML中实现一个Div元素覆盖在另一个Div或图像上的布局技巧,通过CSS样式控制定位,实现层级叠加效果。
摘要由CSDN通过智能技术生成
下面是样式:(1.这里千万要注意一点就是样式与样式之间不能有;号,不然;号后面的样式执行不到
            2.z-index越大越在前面
            3.要使用z-index定位的元素中必须有position为absolute
            4.还有一点就是.qie:hover .showWords{xxxx}这个showWord的class必须在
            .qie元素里面才能被拿到,这是一个筛选)
<style type="text/css">
	.showWords{
		display:none;
		border-radius: 5px;
		width:188px;
		font-size:14;
		color:yellow;
		z-index:2;
		text-align:left;
		margin-top: -230px;
		margin-left: 4px;
		padding-bottom: 12px;
    	        padding-right: 12px;
		padding-left:20px;
		padding-top:16px;
		background-color: blue;
		background-color: #c16;
            background-image: -webkit-gradient(linear, 0 0, 100% 100%,
                  color-stop(.25, rgba(255, 255, 255, .2)), color-stop
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值