Just like the title, I want a box with size 320px*40px, with 4 smaller boxes, size 80px*40px, and with no margin or padding. I used * { margin: 0; padding: 0; }
, but the margin is still there.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
* {
margin: 0;
padding: 0;
}
.box {
height: 40px;
width: 320px;
border-top: 3px solid #ff8500;
border-bottom: 1px solid #edeef0;
}
.box .minibox {
padding: 0;
margin: 0;
text-decoration: none;
display: inline-block;
font-size: 12px;
color: #4C4C4C;
width: 80px;
height: 40px;
line-height: 40px;
text-align: center;
}
.box .minibox:hover {
background-color: #edeef0;
color: #ff8400;
}
</style>
</head>
<body>
<div class="box">
<a href="#" class="minibox">guideline</a>
<a href="#" class="minibox">guideline</a>
<a href="#" class="minibox">guideline</a>
<a href="#" class="minibox">guideline</a>
</div>
</body>
</html>
I tried to add margin: 0; padding: 0;
in the selector of the tag, but nothing happened.