Mam pytanie, odnośnie mojego diva, główny div - "god" jest jakby tłem, i teraz moje pytanie skoro margin w klasnie god jest ustawiony na 0 to dlaczego od góry strony jest odstęp, rozwiązaniem jest margin ujemny, ale mnie zastanawia dlaczego tam jest odstęp skoro margin to 0? i przy wartości 0 powinno nie być odstępu
Pytanie numer 2:
Czy stosowamie marginów ujemnych to jakiś błąd? bo tak rozwiązałem problem aby 3 elementy klasy "row" były koło siebie
margin-left:70px;
margin-right: -40px;
<!DOCTYPE html>
<html>
<head>
<title>Bartek Page</title>
<meta charset="utf-8">
<style>
.main{
}
.row{
float: left;
width: 25.33%;
background-color: azure;
margin-left:70px;
margin-right: -40px;
}
h1{
clear: left;
}
#god{
min-height: 900px;
margin: 0 50px;
//margin: -20px 50px; ##rozwiazanie
background-color: white;
}
body{
margin: 0;
background-color: darkgrey;
}
</style>
</head>
<body>
<div id="god">
<h1>Hello</h1>
<div class="main">
<div class="row">
<h2>Hello</h2>
<p>Before tablets and mobile phones, web pages were designed only for computer screens, and it was common for web pages to have a static design and a fixed size.</p>
</div>
<div class="row">
<h2>Hello</h2>
<p>Before tablets and mobile phones, web pages were designed only for computer screens, and it was common for web pages to have a static design and a fixed size.</p>
</div>
<div class="row">
<h2>Hello</h2>
<p>Before tablets and mobile phones, web pages were designed only for computer screens, and it was common for web pages to have a static design and a fixed size.</p>
</div>
</div>
<h1>Hello again</h1>
</div>
</body>
</html>