【问题标题】:How to place text on the right side of the image?如何在图片右侧放置文字?
【发布时间】:2017-09-17 22:54:34
【问题描述】:

我正在尝试将我的文本“div”放在滑块 div 的空白处。

文字需要放在图片的右侧。 2 个文本 div 块也需要放在第一个 div 下!所以我不知道如何将 div 带到滑块 div 的右侧并将未来的 div 放置在其下方。

【问题讨论】:

    标签: html css image layout slider


    【解决方案1】:

    您可以使用position 设置您的text div

    [selector] {
        position: absolute;
        right : 0px;
        top: 0px;
    } 
    

    【讨论】:

    • 非常感谢!!它实际上对我有用!感谢帮助!
    【解决方案2】:
    <div class="imgWrap clearfix">
        <div class="Slider_img">put img source here</div>
        <div class="content">lorem ipsum</div>
    </div> 
    

    css

    .clearfix 
    {
        zoom: 1;
    }
    .clearfix:before, .clearfix:after {
        content: "";
        display: table;
        line-height: 0;
    }
    .clearfix:after {
        clear: both;
    }
    
    .Slider_img {
        float:left;
        width:70%; 
    }
    .content{
        float:right;
        width:30%;
    }
    

    【讨论】:

      猜你喜欢
      • 2018-08-04
      • 1970-01-01
      • 2015-11-14
      • 1970-01-01
      • 2021-11-19
      • 2014-09-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多