删除了所有多余的东西,我只想使行向左浮动,以便在图像旁边有一些文本,但是它只能移到一行上。使用引导程序(如果有帮助)以及我自己的CSS文件。

example

<!--main body container -->
<div class="container">
  <div class="col-sm-6">
    <div class="row">
      <h1>About Me</h1>
    </div>
    <div id="bio" class="row">
      <img src= "assets/images/linkedin-logo.png" alt="default photo">
        Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam dapibus orci nisl, ut maximus eros congue commodo. Vivamus fermentum dictum erat. Fusce feugiat maximus nulla, eget scelerisque eros sodales vel. Ut vehicula velit nisl, et tempor justo blandit in. Morbi a elit eleifend, efficitur felis sed, pellentesque risus. Praesent quis ante et massa vehicula efficitur. Cras id tortor et elit ornare bibendum non non arcu. Sed lectus enim, consectetur eget pretium in, tempus et quam. Suspendisse elementum porttitor elementum. Donec egestas lectus gravida risus convallis consectetur.
    </div>
  </div>
<!--Main Container End-->
</div>


CSS代码:

#bio {
  float: left;
}

最佳答案

将图片向左浮动

 #bio img {
     float: left;
 }


示例:https://jsfiddle.net/L75dhtny/

关于html - 文字仅在图片旁边左行 float ,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/41950124/

10-11 23:31