Two css3 columns text with an image in middle

耗尽温柔 提交于 2019-12-31 00:56:07

问题


I'd like to achieve this result

there are many tutorial around like this but they work with a fixed text and columns. I print a variable-length text inside my two column layout in this way

#cols {
column-count: 2;
column-gap: 20px;
}
<div id="box">
  <p id="cols">
    Lorem Ipsum....
  </p>
</div>

so I can't use a technique like that, how can I put an image in the middle in this scenario?


回答1:


Here you are:
http://jsfiddle.net/aX47K/

css:

.column{  
   width:300px;  
   float:left;  
   margin-right:20px;  
} 

.column div{  
  width:200px;  
  height:210px;  
}

#col-1 div{
  float:right;
}
#col-2 div{
 float:left;
} 

img#center-image{  
  position:absolute;  
  left:110px;
}


来源:https://stackoverflow.com/questions/11100144/two-css3-columns-text-with-an-image-in-middle

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!