请问实用CSS如何消除A标签的图片边框

html-css08

请问实用CSS如何消除A标签的图片边框,第1张

去除a标签中图片的表框,那就直接css中将a标签中的img的border属性设置为0即可,css如下:

a img{border:0}

这样写的意思就是所有a标签下的图片,边框都为0。

要加分哦

img没边框css样式    img{padding:0border:0margin:0display:block}

截取是 比如图片上的边框是1px

.div{background:url(图片地址) 1px 1px width:图片width-2height:图片height-2}

alert("你懂了吗?")

这个其实很简单,在css中首先第一要做的就是清除默认样式,其中就有一个代码这样写

img{border:0}或者 img{border:none}

img虽然没有border,但是这种情况可以解决遇到a标签包裹的时候出现的问题。

其实楼主可以制作一个属于自己习惯的默认样式,比如我的写法如下,可以给楼主作为参考

*{ margin:0pxpadding:0px}

img{ border:none}

a{ text-decoration:nonecolor: #333333}

a:hover{ text-decoration:nonecolor: #a43130}

li{ list-style: none}