css 这种凹陷下去的效果怎么做

html-css012

css 这种凹陷下去的效果怎么做,第1张

<div>

    <p>Test</p>

</div>

<style>

div {

    width: 200px

    height: 200px

    background: #272727

    border: 1px #272727 solid

}

p {

    width: 158px

    line-height: 158px

    color: #fff

    text-align: center

    margin: 20px auto

    border-radius: 4px

    box-shadow: inset 0px 2px 8px 2px #000000

    border: 1px #666 solid

    border-left: 1px #131313 solid

    border-top: 1px #131313 solid

}

</style>

当圆角过大时深色边和高光边交界处会露陷,要不露陷的话:

边框渐变,貌似支持的浏览器少

不用边框,用两个div嵌套,外面那个比里面那个大1px,然后外面那个用45度的斜方向背景渐变(支持的浏览器多),里面那个用背景色加内阴影。

html标签如下

<ul class="uls">

<li>1        <span class="li-boradiu"></span>

</li>

<li>2        <span class="li-boradiu"></span>

</li>

<li>3</li></ul>

css标签如下

uls{list-style-type: none*zoom: -1}

uls:after{content: ""clear: bothdisplay: block}

uls li{display: blockfloat: leftwidth: 120pxheight: 35pxbackground-color: #4169E1text-align: centerline-height: 35pxcolor: white/*做上圆角*/border-top-left-radius : 15px   border-top-right-radius : 15px   }

li-boradiu{display: inline-blockwidth: 35pxheight: 35px/*background-color: #4169E1*/background-image: radial-gradient(70px at 17.5px 0, #f00)}

css:

a{background:(中间切1-2像素横向循环) repeat-x}

a li{ float:leftbackground:(中间竖线) no-repeat left}

a li a{display:block padding-left:15pxpadding-right:10px}

<div ><img src=前边圆角切图 》</div>

<div class=a>

《ul>

<li style=background:none><a>名称</a></li>

<li><a>名称</a></li>

<li><a>名称</a></li>

</ul>

</div>

<div ><img src=后边圆角切图 》</div>

大体 应该 出来了,在根据自己需要调整一下 就OK了