s_avinash_s 0 Posted September 17, 2018 Report 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 Quote Link to post Share on other sites
dsonesuk 914 Posted September 17, 2018 Report Share Posted September 17, 2018 (edited) height: 60vh; width: 60vw; margin: 20vh 20vw; Edited September 17, 2018 by dsonesuk Quote Link to post Share on other sites
s_avinash_s 0 Posted September 17, 2018 Author Report 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 Quote Link to post Share on other sites
dsonesuk 914 Posted September 17, 2018 Report 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. Quote Link to post Share on other sites
s_avinash_s 0 Posted September 17, 2018 Author Report Share Posted September 17, 2018 i didnt get..any example is available Quote Link to post Share on other sites
dsonesuk 914 Posted September 17, 2018 Report Share Posted September 17, 2018 <body> <div> </div> </body> Quote Link to post Share on other sites
shaili_shah 2 Posted August 7, 2019 Report Share Posted August 7, 2019 body.div { background: gray; height: 60vh; width: 60vw; margin: 20vh 20vw; } Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.