English 中文(简体)
• 如何按照中央安排绘制2幅图像?
原标题:How to draw 2 images with align by central?
  • 时间:2011-10-12 17:48:39
  •  标签:
  • html
  • css

我的问题是关于超文本的问题——我需要安排2个线中央图像(线相同),但我还需要书写每个图像的权利文本;案文必须按垂直而不是图像编排。 我如何能够这样做?

最佳回答

你可以做以下工作:

<div class="container">
    <div class="img1">
        <img src="http://www.veryicon.com/icon/png/Nature/Nature/Red%20Flower.png" />
        <span>This is flower1</span>
    </div>
    <div class="img2">
        <img src="http://www.veryicon.com/icon/png/Nature/Nature/Red%20Flower.png" />
        <span>This is flower2</span>
    </div>
</div>

<<>CSS:

div.container {
     margin: auto;
      width: 700px;  
    text-align: center;
    position: relative;
}

div.img1 {
    position: absolute;
     left: 0px;
}

div.img2 {
    position: absolute;
     right: 0px;   
}

img {
    vertical-align: middle;
}

下面请见

问题回答

从老的意义上来说,你可以使用一个边界表:0、1行和4col。 表格和标记使你能够调整纵向和横向。 这是满足你要求的一个非常简单的方法,但可能不是更好。

此外,你可以与干.保持一致。





相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签