html - 如何在文本旁边获取图像?

标签 html css

我正在寻找我的证书图像和图像右侧的文本。无论窗口大小如何,我都希望它们彼此相邻。

<div class="ISO">
  <div class="container">
    <h2>Certification</h2>
    <section class="container">
      <div class="row">
        <figure class="col-sm-6">
          <img src="http://i.imgur.com/wQQP94Y.jpg">
        </figure>
        <figure class="col-sm-6">
          <p><u>GOVERNMENT SUB-CONTRACTOR INFORMATION</u>
            <br> CCR and ORCA Registered US Government Sub-Contractor
            <br> Company CAGE Code: 4STK5
            <br>
            <u>Business Certifications:</u>
            <br> Veteran Owned - Small Business
            <br> ISO 9001-2015 Certificate Number 16.127.1
            <br> Labor Surplus Region
            <br>
            <br>
            <u>NAICS Codes:</u>
            <br> 332710 – Machine Shops
            <br> 332721 – Precision Turned Product Manufacturing
            <br>
            <br>
            <u>Potential Federal Supply Classifications:</u>
            <br> 1005/1010 – Guns – 30mm – 75mm
            <br> 1650 – Aircraft Hydraulic, Vacuum and De-icing System Components
            <br> 1660 – Aircraft Air conditioning , heat and pressurizing equipment
            <br> 2590 – Miscellaneous vehicle components
            <br> 2910/2915 – Fuel System Components
            <br> 2930/ 2935 – Engine Cooling System Components
            <br> 4130 – Refrigeration and Air Conditioning components
            <br> 7320 – Kitchen Equipment and appliances (components)
            <br>
            <br>
          </p>
        </figure>
      </div>

https://jsfiddle.net/dhalldow/ggzf8acf/

最佳答案

您正在使用 Bootstrap 类,但您没有在代码中包含 bootstrap.css。要么包括 bootstrap css,要么您可以添加自定义样式。

* {
    margin: 0;
    padding: 0;
    box-sizing:border-box;
}

.col-sm-6 {
    width: 50%;
    float: left;
}

img {
  width: 100%;
}

将以下样式添加到您的 CSS。

关于html - 如何在文本旁边获取图像?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44316577/

相关文章:

javascript - 使用 Javascript CSS 属性添加背景图片

jquery - 将绝对元素水平放置在视口(viewport)内

css - 删除 styleClass 时 applyCss 不起作用

javascript - Jquery - IE 滚动中的断断续续的动画

javascript - 如何动态创建嵌入到页面的多个 YouTube 视频?

javascript - 有什么方法可以使它动画化吗?我正在制作的 HTML 游戏

javascript - 分区宽度 :100% will over the browser window border

html - float CSS后Div崩溃

css - 填充和边距之间的区别?

css - 如何缩放我的 css/html 下拉菜单?