according to the code , i want to marge the inner div "smedia" down ,it's not working unless i'm giving the outer div "layout" a padding value , need an explanation for that
also i figured that this can be solved by giving the "inner div" inline-block value ONLY not even block value , i need an explanation for that also
h1,h2,h3,p,div,section,header,footer,section,article,nav,ul,html,body
{
margin: 0;
padding: 0;
}
li{list-style-position: inside;list-style-type: none;}
body{background-color:white}
*{box-sizing: border-box;}
a{text-decoration: none;}
.header-text{text-align:center;}
.layout{width: 60%;margin: auto; background-color: #4DC1E8;height:300px;padding-top: 0px;}
.smedia{width:200px;background-color: antiquewhite;margin-top: 90px;}
.logo{border-right-style: solid;}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<link rel="stylesheet" href="p3css.css" >
</head>
<body>
<h1 class="header-text">Clean Profile Widget</h1>
<div class="layout">
<div class="smedia">
<span class="logo">FB</span>
<span class="logo">TWR</span>
</div>
</div>
</body>
</html>
when giving padding
h1,h2,h3,p,div,section,header,footer,section,article,nav,ul,html,body
{
margin: 0;
padding: 0;
}
li{list-style-position: inside;list-style-type: none;}
body{background-color:white}
*{box-sizing: border-box;}
a{text-decoration: none;}
.header-text{text-align:center;}
.layout{width: 60%;margin: auto; background-color: #4DC1E8;height:300px;padding-top: 1px;}
.smedia{width:200px;background-color: antiquewhite;margin-top: 90px;}
.logo{border-right-style: solid;}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<link rel="stylesheet" href="p3css.css" >
</head>
<body>
<h1 class="header-text">Clean Profile Widget</h1>
<div class="layout">
<div class="smedia">
<span class="logo">FB</span>
<span class="logo">TWR</span>
</div>
</div>
</body>
</html>
thanks in advance.