When resizing the browser window the browser just reduces the space after the element. I want to decrease the space equally on the left and right as it is done in Facebook.
Here is my code
CSS:
body{
margin-left:10%;
margin-right:10%;
}
HTML:
<body>
Some content
.
.
.
.
</body>
First I thought of giving a min-width to body. But computers having less screen size will be a problem. Also min-width will not be good solution.
Just give width
80%to yourbodyand givemargin-leftandmargin-righttoautofor center aligningsuggestion:
To give styles to body is not a good practice, give styles to top parent div in your page
like this,
CSS: