这是我当前的代码:如何在html中并排放置2个图像?
<figure class="half">
<img style="width:400px" src="http://alexmarshall12.github.io/assets/img/colored_1693146.png">
<img style="width:600px" src="http://alexmarshall12.github.io/assets/img/one-piece-1693146_colored2.png">
<figcaption>Caption describing these two images.</figcaption>
</figure>
可惜也许是因为图像是太宽,但仍把下一行的第二图像。我想避免这种情况 - 不管事情有多宽。我怎样才能做到这一点?
只要把两张图片在两个部门,并把这两个师在一个主要部门。使用float:left并排放置 –
如果你想在每一个可能的屏幕尺寸上并排放置图像,你可以这样做:https://jsfiddle.net/zvv38vup/1/无论如何,我宁愿使用较低屏幕分辨率的媒体查询,并将一个放在另一个之上(对于较低的屏幕尺寸) – sinisake