Display two images side by side on an HTML Page

后端 未结 7 1829
渐次进展
渐次进展 2021-01-06 07:09

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 a

相关标签:
7条回答
  • 2021-01-06 07:55

    You can use float:left.

    html:

    <div id="row">
        <img class="left" src="" />
        <img class="left" src="" />
    </div>
    

    css:

    .left{
        width: 250px;
        height: 250px;
        float: left;
    }
    
    //If you don't want margins
    body{
        margin:0;
        padding:0;
    }
    

    Fiddle

    0 讨论(0)
提交回复
热议问题