Text Wrapping around an absolute positioned div

后端 未结 10 1835
感动是毒
感动是毒 2020-12-03 13:25

I know there are a few questions about similar topics but they mostly amount to floating the div/image. I need to have the image (and div) positioned absolutely (off to the

10条回答
  •  庸人自扰
    2020-12-03 13:54

    I know this is an older question but I came across it looking to do what I believe you were trying to. I've made a solution using the :before CSS selector, so it's not great with ie6-7 but everywhere else you should be good.

    Basically, putting my image in a div I can then add a long thing float block before hand to bump it down and the text wraps merrily around it!

    img {
      float:right;  
      clear:both;
      width: 50% ;
      margin: 30px -50px 10px 10px ;
    }
    .rightimage:before {
      content: '' ;
      display:block;
      float: right;
      height: 200px;
    
    }
    

    You can check it out here:

    http://codepen.io/atomworks/pen/algcz

提交回复
热议问题