Jump to content

[HTML & CSS] Sidebar not pushing position absolute objects

WillLTT
Go to solution Solved by C2dan88,

Avoid using positioning, use padding/margin instead?

h1 {
	margin-top: 1.5em;
}

 

Sidebar not pushing position absolute objects..

sidebar:

https://www.w3schools.com/howto/tryit.asp?filename=tryhow_js_collapse_sidebar

 

add a

position: absolute; 

to a <h1> and i for some reason i does not push it away when you open the sidebar.

like what it would if you removed the position tag.

 

I cant use top: 150%; without using position tag.

Link to comment
Share on other sites

Link to post
Share on other sites

Avoid using positioning, use padding/margin instead?

h1 {
	margin-top: 1.5em;
}

 

Link to comment
Share on other sites

Link to post
Share on other sites

Absolutely positioned objects completely ignore spacing except for what you set it to using the top/bottom/left/right properties. The only thing that absolutely positioned objects follow is the render order.

 

Don't use absolutely positioned objects unless you... well... absolutely have to.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×