Sunamena Posted March 30, 2016 Share Posted March 30, 2016 Hey there. I was wondering if this is possible. This is what i want to achieve on my page (within a div or within a body). first 15%: color:gray center 70%: color:white last 15%: color:gray Is this possible? How can one achieve this?Thanks in advance =D Link to comment Share on other sites More sharing options...
dsonesuk Posted March 30, 2016 Share Posted March 30, 2016 Solid?, gradient?, flexible to content or browser window? Need more input. Link to comment Share on other sites More sharing options...
Sunamena Posted April 2, 2016 Author Share Posted April 2, 2016 Like this example (they use a background for this but I wonder if there is a more apropiate way to do this. http://hetperspectief.net/index.html Link to comment Share on other sites More sharing options...
dsonesuk Posted April 2, 2016 Share Posted April 2, 2016 (edited) It can be done simply using position: absolute/fixed; element/s, these elements can have required background. Your example body, html {height: 100%;} body { background-color: gray; } /* option 1 with element using id ref body_bg */ body > #body_bg { background-color: white; position: absolute /* or fixed */; height: 70%; top: 15%; left: 0; right:0; z-index:0;} /* end option 1*/ /*option 2 using content: */ body:before { content:""; position: absolute; top: 15%; left: 0; right: 0; background-color: white; height: 70%; z-index: 0; } /* end option 2 */ body > * {position: relative; } Edited April 2, 2016 by dsonesuk Link to comment Share on other sites More sharing options...
john256 Posted April 8, 2016 Share Posted April 8, 2016 Try this one code : <div id="outPopUp"></div> #outPopUp { position: absolute; width: 300px; height: 200px; z-index: 15; top: 50%; left: 50%; margin: -100px 0 0 -150px; background: red; } Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now