+ 2
In this code how to remove the white boundary around the div element? Means I want to cover full space with a colour.
link--https://code.sololearn.com/WwopKswZN0E2/?ref=app please help.. Thanks....
6 ответов
+ 8
that's the correct solution:
HTML:
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<div>Hello</div>
</body>
</html>
--------------------
CSS:
body {
margin:0;
}
div{
background-color:red;
height:300px;
}
+ 7
body{
margin:0;
}
Every element of html has default css propertied so you can reset them, in this case you can set margin:0 to all elements:
*{
margin:0;
}
+ 2
use this
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body><!--by ThreeG-->
<h1>welcome guys</h1>
</body>
</html>
body {
background:red;
}
+ 2
thanks Kamil it was exactly what i want
0
thank you @ThreeG but this code is working only for side margins, what about top?
0
but i don't want to fix it