html边框阴影加特定的边,css – 位置框阴影宽度特定宽度

我尝试为div元素添加阴影.但只有div的宽度的90%和边距 – 从10%左侧.这是尝试

33.12

CSS

#shadow{

position:relative;

height:5px;

z-index:0;

width:96%;

left:3.7%;

top:-6px;

-moz-Box-shadow: 0px 5px 4px #888;

-webkit-Box-shadow: 0px 5px 4px #888;

Box-shadow: 0px 5px 4px #888;

}

但似乎百分比值不属于“标题后”的大小.在不同的屏幕分辨率上有不同的值.我究竟做错了什么?

例:

RES1:

> —————-标题

> ————影子

RES2:

> —————-标题

> —————–影子

UPDATE

我的CSS

#post-headline {

position:relative;

background-color: #3366cc;

color:#fff;

left:-60px;

height: 40px;

width: 106.5%;

z-index:1;

}

#post-headline:after{

content: " ";

position:absolute;

width: 95.7%;

right: 0;

bottom: 0;

height: 20px;

-moz-Box-shadow: 0px 5px 4px #888;

-webkit-Box-shadow: 0px 5px 4px #888;

Box-shadow: 0px 5px 4px #888;

}

#post-headline-title {

margin-left: 60px;

}

#post-headline-author{

font-weight:bold;

margin-left:60px;

}

#post-headline-date{

position:absolute;

margin:8px;

font-weight:bold;

font-size:12px;

}

#post-headline-triangle

{

z-index:-1;

left: -51.7px;

top:-31px;

height:45px;

width:45px;

background-color:#0033cc;

transform: rotate(30deg);

-ms-transform: rotate(30deg); /* IE 9 */

-webkit-transform: rotate(30deg); /* Safari and Chrome */

}

33.12

...

仍然不起作用:/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值