在HTML页面上并排显示两个图像

人气:1,188 发布:2022-09-19 标签: html image css html-table

问题描述

我试图将两个相同大小的图像并排放置。如果我使用,那么我可以并排显示这两个图像。但在我的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" />

942