构成单个图像的多个图像 [英] Multiple images making up a single image

查看:76
本文介绍了构成单个图像的多个图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想让3张图像看起来像单个图像作为某些文字的背景。我看过很多四舍五入的事情。技术,基本上这看起来像一个带圆角的盒子,但我不喜欢我所见过的所有技术中涉及的css和/或html的数量。我的下一次尝试是将3个单元放在一起构成图像,这是可以的,除了我需要它跨越整个宽度,所以第一个单元格是图像的宽度,第二个单元格重复页面的宽度减去左图像的宽度减去右图像的宽度,最后一个单元格是图像的宽度。我将在多个页面上的多个位置使用它,所以我需要一个优雅的解决方案,在一个地方放置尽可能多的工作以供重用。

I have 3 images that I want to make look like a single image as a background to some text. I have looked at a lot of "rounding" techniques, basically this will look like a box with rounded corners, but I don''t like the amount of css and/or html involved in all the techniques I have seen. My next attempt was to put 3 cells together to make up the image, this is okay except that I need it to span the entire width, so the first cell is the width of the image, the second repeats for the width of the page minus the width of the left image minus the width of the right image, the last cell is the width of the image. I will be using this in multiple places on multiple pages, so I need an elegant solution that puts as much work in one place for reuse.

推荐答案

PS这需要在IE中工作,但我们也可能支持firefox,仍然决定,所以最好在两者中都有效。
PS This needs to work in IE, but we might support firefox as well, still deciding, so preferrably something that works in both.


我认为使用css定位你的图像是最有意义的: />
I think it makes most sense to use css to position your images:
展开 | 选择 | Wrap | 行号


我真的需要更通用的东西。假设你所知道的只是你图像的高度。你不知道它在页面上有多宽,这是我遇到的最大问题,你只想要3个图像占据该空间的100%所以你假设的中间图像是100px但是我不知道它到底会有多宽。


另一个目标是使编码器尽可能少编写代码,因为我们将在很多情况由不同的程序员写在不同的页面上。如果解决方案有相当数量的html,那没关系因为我们正在使用jsf而且我可以制作一个标签来生成那个html。


所以我的两个最大的问题是,如何当你不知道宽度是多少时,占据宽度的100%,并使其足够灵活,可以在多个地方使用而不会一遍又一遍地写入大量的代码。


BTW感谢您的快速回复。
I really need something that is more generic. Assume all you know is the heigth of your images. You don''t know how wide it will be on the page, this is the biggest problem I''m having, you just want the 3 images to take up 100% of that space so the middle image you are assuming goes for 100px but I don''t know how wide it really will be.

Another goal is to make it so the coder has as little code to write as possible, because we will use this in a lot of situations written on various pages by different programmers. If the solution has a fair amount of html, that is okay because we are using jsf and I can make a tag to generate that html.

So really my 2 biggest problems are, how to take up 100% of the width when you don''t know what that width is, and make it flexible enough to be used in multiple places with out writing a large amount of code over and over again.

BTW thanks for your quick response.


这篇关于构成单个图像的多个图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆