代码之家  ›  专栏  ›  技术社区  ›  Maverick

使用CSS在多个框的底部创建固定文本

  •  0
  • Maverick  · 技术社区  · 14 年前

    我正在使用CSS在具有标准高度的预览文章框底部对齐文本(这只是一个“阅读更多”链接)。“阅读更多”链接现在显示在摘要文本的正下方,我需要将其放置在文章框底行上方几个像素的位置,而不受文本高度的影响,如下图所示。

    ___________________________
    |
    |
    |
    |
    |
    |              read more >>
    |___________________________
    

    你能给我一些想法或例子吗?

    当做, 乔治

    4 回复  |  直到 14 年前
        1
  •  2
  •   Gabriele Petrioli    14 年前

    将文章元素设置为 position:relative 然后设置 多读 链接到 position:absolute 以便您可以使用 bottom / right CSS属性..

    http://www.jsfiddle.net/gaby/7bduy/

        3
  •  0
  •   Kobby    14 年前

    #selectorName{
        position:relative;
        left: 10px;
        top:10px;
        bottom:10px;
        right:10px;
    }
    

        4
  •  0
  •   dooburt    14 年前

    <div class="article">
    <div class="readmore"><a href="#">read more ></a>
    </div>
    

    .article 
    {
    position relative;
    width: 300px;
    height: 100px;
    }
    .readmore
    {
    position:absolute;
    z-index:3;
    width:50px;
    height:25px;
    right:0px;
    top:280px;
    }
    

    推荐文章