在HTML页面上并排显示两个图像 [英] Display two images side by side on an HTML Page

查看:1104
本文介绍了在HTML页面上并排显示两个图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图将两个相同大小的图像并排放置。如果我使用,那么我可以并排显示这两个图像。但在我的CSS样式表我使用自定义格式的表,这也显示在包含图像的页面上。



我想只显示没有任何自定义背景,边框等的图片。



code> div , span ul li (等),但在每种情况下都失败。


  1. 可以在一行中放置两个图像(大小相同),而不使用


  2. 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.

  1. How can I place two images (of the same size) in a single line, without using a table?

  2. 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屋!

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