Break element out of container

前端 未结 7 615
暖寄归人
暖寄归人 2021-02-02 09:00

I have all my content wrapped in a container element with a fixed width.

But I have a

that I want to \"break out\" of that container to span the
7条回答
  •  鱼传尺愫
    2021-02-02 09:57

    You could use negative margins to achieve this.

    .wrapper {
        width:300px;
        margin:0 auto;
    }
    .break {
        width: 600px;
        margin-left:-150px;
    }
    

    The only problem is that you would need to specify the width of both elements.

    EDIT: voodoo417's solution would be better...

提交回复
热议问题