How to make
full width?

后端 未结 5 1633
走了就别回头了
走了就别回头了 2021-02-19 08:03

http://jsfiddle.net/bh2f6/1/

I want to make this


so it will stretch the full width, right to the edges of its parent container. I have tried add
5条回答
  •  难免孤独
    2021-02-19 08:43

    Your width:100%; on the


    and the padding on the parent were messing things up. The
    naturally stretches across the screen and doesn't need width:100%, so remove it. Then to compensate for the padding, just add the same negative margin to the
    .

    Change your CSS to this:

    .single-article hr {
        margin: 30px -20px 20px;
        border: 0;
        border-top: 1px solid #c9c7c7;
    }
    

    See working jsFiddle demo

提交回复
热议问题