html - 如何在html中显示图像和左侧和文本右侧

标签 html css

您好,在下面的代码中,我想在左侧显示图像,文本应该在右侧。但现在它显示在图像的下方。以及一行中的 3 个图像,就像图像和文本一样。

.specilites{
    width: 1050px;
    margin: 0 auto 0 auto;
    padding-top:7px;
    color:#008080;
    font-size:30px;
}
.specilites img{

    background-repeat: no-repeat;
    background-size: cover;
    overflow:hidden;
    -webkit-border-radius:50px;
    -moz-border-radius:50px;
    border-radius:50px;
    width:90px;
    height:90px;
    display:inline-block;
     border: 1px solid #008080;
}
.specilites h1{
    width: 1050px;
        margin: 0 auto 0 auto;
        padding-top:7px;
        color:#008080;
        font-size:30px;
    }
    .specilites td{
        font-size:15px;
         display:block;

    }
<div class="specilites">
    <table>
        <tr>
        <td>
        <img src="http://lorempixel.com/400/200"/>
       Accident & Emergency Care</td>
         <td><img src="http://lorempixel.com/400/200"/></td>
         <td> <img src="http://lorempixel.com/400/200"/><td>
        </tr>
        <img src="http://lorempixel.com/400/200"/>
        <img src="http://lorempixel.com/400/200"/>
        <img src="http://lorempixel.com/400/200"/>
        <img src="http://lorempixel.com/400/200"/>
         <img src="http://lorempixel.com/400/200"/>
        <img src="http://lorempixel.com/400/200" />
         <img src="http://lorempixel.com/400/200" />
          <img src="http://lorempixel.com/400/200" />
            <img src="http://lorempixel.com/400/200" />
             <img src="http://lorempixel.com/400/200" />
              <img src="http://lorempixel.com/400/200" />
          <img src="http://lorempixel.com/400/200" />
          <img src="http://lorempixel.com/400/200" />
      </table>
</div>

最佳答案

假设您想要在一行中放置 3 张图片,图片左边是文字,右边是文字。演示 Here

.specilites{
    width: 1050px;
    margin: 0 auto 0 auto;
    padding-top:7px;
    color:#008080;
    font-size:30px;
}
.specilites img{

    background-repeat: no-repeat;
    background-size: cover;
    overflow:hidden;
    -webkit-border-radius:50px;
    -moz-border-radius:50px;
    border-radius:50px;
    width:90px;
    height:90px;
    display:inline-block;
     border: 1px solid #008080;
}
.specilites h1{
    width: 1050px;
        margin: 0 auto 0 auto;
        padding-top:7px;
        color:#008080;
        font-size:30px;
    }
    .specilites td{
        font-size:15px;
     /*    display:block;*/

    }
<div class="specilites">
    <table>
        <tr>
            <td><img src="http://lorempixel.com/400/200"/></td>
            <td>Accident & Emergency Care</td>
            <td><img src="http://lorempixel.com/400/200"/></td>
            <td><img src="http://lorempixel.com/400/200"/></td>
        </tr>
        <tr>
            <td><img src="http://lorempixel.com/400/200"/></td>
            <td><img src="http://lorempixel.com/400/200"/></td>
            <td><img src="http://lorempixel.com/400/200"/></td>
        </tr>
         <tr>
            <td><img src="http://lorempixel.com/400/200"/></td>
            <td><img src="http://lorempixel.com/400/200"/></td>
            <td><img src="http://lorempixel.com/400/200"/></td>
        </tr>
         <tr>
            <td><img src="http://lorempixel.com/400/200"/></td>
            <td><img src="http://lorempixel.com/400/200"/></td>
            <td><img src="http://lorempixel.com/400/200"/></td>
        </tr>
         <tr>
            <td><img src="http://lorempixel.com/400/200"/></td>
            <td><img src="http://lorempixel.com/400/200"/></td>
            <td><img src="http://lorempixel.com/400/200"/></td>
        </tr>

      </table>
</div>

关于html - 如何在html中显示图像和左侧和文本右侧,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29384196/

相关文章:

javascript - 如何使固定元素消失在非固定元素后面

javascript - CSS悬停效果过渡会改变颜色吗?

html - 如何创建一个 HTML 按钮,它就像指向同一页面上的项目的链接?

html - Firefox 和 IE 中的 CSS 动画支持?

jquery - 在 jQuery 切换它之后,将 div 放置在特定的动态 Rails 元素旁边

javascript - 如何将当前幻灯片编号和淡入淡出效果添加到简单的幻灯片

javascript - 如何在不禁用 JQuery 按钮的情况下停止表单提交?

css - 如何在 primeng 确认对话框模式中设置确认按钮的样式?

html - 在 angular 6 应用程序中的 ngFor 指令内自动将 Div 推到右边

javascript - 使用 2 个函数和 onchange 事件处理程序计算 5 个数字的平均值