在HTML页面上并排显示两个图像 [英] Display two images side by side on an HTML Page
问题描述
我试图将两个相同大小的图像并排放置。如果我使用表
,那么我可以并排显示这两个图像。但在我的CSS样式表我使用自定义格式的表,这也显示在包含图像的页面上。
我想只显示没有任何自定义背景,边框等的图片。
code> div , span
, ul
li
(等),但在每种情况下都失败。
-
可以在一行中放置两个图像(大小相同),而不使用
表
? - p>如果我必须使用
table
,那么如何使用CSS为我的表使用两种(或更多)不同的格式?
您可以这样做:
< style type =text / css>
.left {float:left;}
< / style>
< img class =leftsrc =path here/>
< img class =leftsrc =path here/>
I am trying to place two images of the same size side-by-side. If I use a table
then I am able to display both images side-by-side. But in my CSS Stylesheet I am using a custom format for the table and this shows on the page containing the images, too.
I want to just display both images without any custom background, border, etc.
I tried using div
, span
, ul
& li
(etc.) but failed in each case.
How can I place two images (of the same size) in a single line, without using a
table
?If I have to use
table
for the same, then how can I use two (or more) different formats for my tables using CSS?
You can do like:
<style type="text/css">
.left{float:left;}
</style>
<img class="left" src="path here" />
<img class="left" src="path here" />
这篇关于在HTML页面上并排显示两个图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!