Robin Saletti
Robin Saletti

Reputation: 21

How to put a div outside the body?

Im putting a box using jQuery (show) on top of the page. I want the whole page to move down when it's showing, even the body background image which size is set to contain to be responsive. Since the div is placing itself inside the body tag, the background image wont place itself underneith the box.

How can I make the background image relative so it will be pushed down when box is showing?

body{
font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
font-size: 14px;
line-height: 1.42857143;
color: #333;
background-color: #fff;
background-repeat: no-repeat;
background-image: url(../images/SELFIE-first.jpg);
background-size: contain;
background-position: top;
}

Upvotes: 2

Views: 8741

Answers (1)

emmanuel
emmanuel

Reputation: 9615

You can't put something outside of <body> tag.

You have to create a container div with all of your content and place the background to that div. Then your jquery box could be placed above that.

Upvotes: 3

Related Questions