Html 旧浏览器的边界图像实现
如何为旧浏览器实现边框图像?Html 旧浏览器的边界图像实现,html,css,Html,Css,如何为旧浏览器实现边框图像? 我有8张图片: 4个边框图像(border-top.gif、border-right.gif、border-bottom.gif、border right.gif) 和4个border Conner(Conner的外部是透明的,这很重要):border-top-left.gif,border-top-right.gif,border-bottom-right.gif,border-bottom-left.gif,还有下一个标记: <div class"bloc
我有8张图片:
4个边框图像(border-top.gif、border-right.gif、border-bottom.gif、border right.gif)
和4个border Conner(Conner的外部是透明的,这很重要):border-top-left.gif,border-top-right.gif,border-bottom-right.gif,border-bottom-left.gif,还有下一个标记:
<div class"block">
<div class="content">A lot of text with images and tables</div>
<div class="border-top"></div>
<div class="border-right"></div>
<div class="border-bottom"></div>
<div class="border-left"></div>
<div class="border-top-left"></div>
<div class="border-top-right"></div>
<div class="border-bottom-right"></div>
<div class="border-bottom-left"></div>
</div>
大量包含图像和表格的文本
有CSS解决方案吗?如果需要,我可以将类添加到标记中。UPD:我知道用table很容易,但我想找到div的解决方案。
UPD2:带有渐变的图像,因此没有图像是无法实现的。我建议使用CSS精灵。这样,您就不必浪费时间对图像进行切片。允许CSS背景位置声明为您完成工作 请参阅:
- 容器(.block)的相对位置
- 容器内拐角div元素的绝对位置
<style type="text/css"> .block { display:block;position:relative; } .border-top-left { display:block; background-image:url(/folder/topleftcorner.png); background-repeat:no-repeat; width:10px; height:10px; /* size of your corner graphic above */ /* this puts it where you want it */ position:absolute; top:0; left:0; } </style>
要使其余部分相匹配是否要创建圆形边框?或者只是普通的边界?我不明白为什么不能直接使用border:1px solid#000;对于常规。。。否则,对于圆形,我建议所有的图像都是透明的吗?你可能还想看看,这实际上取决于你的边框是如何设计的。在大多数情况下,你甚至不需要图像,但在某些情况下,这是无法避免的。。。另外,对于旧版浏览器,我假设你指的是cssround.com的IE6和IE7thx,但是顶部、左侧、底部、右侧边框图像都有渐变,所以这个网站没有帮助我了解css精灵,但在使用sprites之前,我需要在没有sprites的情况下使用它,这里有3个sprites:4_conners,top_bottom_border,left_right-border我从它开始,但我不知道如何放置非角边框,嗯,我知道怎么做,但顶部边框在conners的透明部分是可见的。这个问题在:(添加z-index:1,z-index:2以适应-(2在页面上比1高)到css中,听起来你需要按顺序排列(z-index)堆栈以适应。z-index是我们的第三维度..whahayyyyso上边框的宽度应该为100%-32px*2(32px-我的角的大小)我们不知道你的“上边框”是-如果你在一张纸上画出来,用箭头标识每个角元素,它的大小和位置,你就会清楚你的css需要做什么-绝对位置和它的左、右、底和顶值是关键。z索引没有帮助,因为角图像的外部是透明的right:0; bottom:0