s_avinash_s Posted September 17, 2018 Share Posted September 17, 2018 Hi Am working on web server. I need a background color not on the full page.but only 60% of my screen and to be in the middle. So that i can add my tabs on that 60% of the page Please help Link to comment Share on other sites More sharing options...
dsonesuk Posted September 17, 2018 Share Posted September 17, 2018 (edited) height: 60vh; width: 60vw; margin: 20vh 20vw; Edited September 17, 2018 by dsonesuk Link to comment Share on other sites More sharing options...
s_avinash_s Posted September 17, 2018 Author Share Posted September 17, 2018 (edited) HI I tried like below: body { background: lightblue; height: 60vh; width: 60vw; margin: 20vh 20vw; } But still getting full screen of background color I try to modify it here https://www.w3schools.com/code/tryit.asp?filename=FVCO9L8U59J4 Edited September 17, 2018 by s_avinash_s Link to comment Share on other sites More sharing options...
dsonesuk Posted September 17, 2018 Share Posted September 17, 2018 That won't work on the body the background-color applied to body will always fill the whole browser window. you need to use a container block element within the body. Link to comment Share on other sites More sharing options...
s_avinash_s Posted September 17, 2018 Author Share Posted September 17, 2018 i didnt get..any example is available Link to comment Share on other sites More sharing options...
dsonesuk Posted September 17, 2018 Share Posted September 17, 2018 <body> <div> </div> </body> Link to comment Share on other sites More sharing options...
shaili_shah Posted August 7, 2019 Share Posted August 7, 2019 body.div { background: gray; height: 60vh; width: 60vw; margin: 20vh 20vw; } 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