html - 并排漂浮

标签 html css

我想响应式地并排 float 以下代码。我怎样才能做到这一点?

enter image description here

这是 HTML:

<img src="http://www.iliveaccountable.com/wp-content/uploads/2015/12/free-membership-300x188.jpg" alt="free-membership" width="300" height="188" class="alignnone size-medium wp-image-14074" /> 

<h3>Today’s Price: 100% FREE</h3>
<p><strong>ONLINE VIDEO COURSE</strong></p>
<p><strong>Availability</strong>: Immediate Access in Members Area</p>
<button class="btn btn-primary">GET ACCESS NOW</button>

<img src="http://www.iliveaccountable.com/wp-content/uploads/2015/12/satisfaction-guaranteed-300x300.png" alt="satisfaction-guaranteed" width="300" height="300" class="alignnone size-medium wp-image-14075" />


You can get started right now, in this moment, to shift your life to a more powerful, more accountable life! We offer a free video series that shares insights into the mindset of a victim, the characteristics and verbiage victims unknowingly use, and some steps and tools to live a more accountable life! 

We also clarify some of the misconceptions of accountability and why it is that for many, accountability is something that is avoided, when in truth, it is the key to a more free, powerful fulfilling life!!!

这是 CSS:

.right{
float: right;
}

.left{
float: left;
}

这是 jSFIDDLE:https://jsfiddle.net/6totya08/

最佳答案

使用bootstrap,您可以轻松实现这种响应式设计。

  <div class="row">
   <div class="col-md-4">
    <img src="http://www.iliveaccountable.com/wp-content/uploads/2015/12/free-membership-300x188.jpg" alt="free-membership" width="300" height="188" class="alignnone size-medium wp-image-14074" /> 
   </div>
   <div class="col-md-4">
     <h3>Today’s Price: 100% FREE</h3>
     <p><strong>ONLINE VIDEO COURSE</strong></p>
     <p><strong>Availability</strong>: Immediate Access in Members Area</p>
     <button class="btn btn-primary">GET ACCESS NOW</button>
   </div>
   <div class="col-md-4">
     <img src="http://www.iliveaccountable.com/wp-content/uploads/2015/12/satisfaction-guaranteed-300x300.png" alt="satisfaction-guaranteed" width="300" height="300" class="alignnone size-medium wp-image-14075" />
   </div>

 </div>
 <div class="row">
    <div class="col-md-12">
        You can get started right now, in this moment, to shift your life to a more powerful, more accountable life! We offer a free video series that shares insights into the mindset of a victim, the characteristics and verbiage victims unknowingly use, and some steps and tools to live a more accountable life! 
       We also clarify some of the misconceptions of accountability and why it is that for many, accountability is something that is avoided, when in truth, it is the key to a more free, powerful fulfilling life!!!
   </div>
 </div>

DEMO

关于html - 并排漂浮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34389989/

相关文章:

javascript - 悬停的最佳实践?

css - 将图像设置为标准尺寸

html - 将颜色值分配给 css 变量

html - Svg 数字 - 需要缩放和翻译,Chrome 和 Firefox 之间的区别

html - 将卡片上的垂直文本与图像对齐

jquery - 嵌套的 SAME 元素。当 :hover child, 禁用时:悬停父 CSS

html - 居中 React-Grid-Gallery ReactJS 库

css - 用填充收缩元素

html - 无法将表单提交到 freecodecamp 模拟 url

PHP PDO 从数据库中选择并显示在特定的 div 中