text-align实现的右外侧定位效果实例页面

展示

  • HTML:
    <div class="constr">
        <div class="alignright">
            <span class="follow">
                <img src="circle.png">
                <img src="backtop.png">
            </span>
        </div>
    </div>
  • CSS:
    .constr {
        width: 80%;
        margin: auto;
        background-color: #f0f3f9;
    }
    .alignright {
        height: 0;
        text-align: right;
        overflow: hidden;
    }
    .alignright:before {
        content: "\2002";
    }
    
    .follow {
        position: fixed;
        bottom: 100px;
        z-index: 1;
    }
    .follow > img {
        display: block;
        margin: 10px;
    }