Witam, dopiero zaczynam przygodę z programowaniem i bardzo prosze o wyrozumiałość.Cały dzień przed komputerem nie służy obiektywnemu i logicznemu spojrzeniu na sprawę a iść spać w niewiedzy to też żadne rozwiązanie.Pyanie mam tego typu, ale może najpierw kod:
HTML
<!DOCTTYPE HTML>
<html lang="pl">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<title>Mariusz Andrzejewski - Portfolio </title>
<meta name="description" content="Stworzę dla Ciebie wyjątkową stronę www! Zatrudni programistę webowego: PHP, JavaScript, HTML, CSS, MySQL, WordPress, Joomla, Drupal." />
<meta name="keywords" content="zamów, stronę, tworzenie, www, programista, portfolio, php, javascript, html, css, WordPress, Joomla, Drupal"/>
<link rel="stylesheet" href="style.css" type="text/css" />
<link href="https://fonts.googleapis.com/css?family=Josefin+Sans|Lato|Open+Sans" rel="stylesheet">
</head>
<body>
<div id="container">
<div class="rectangle">
<div id="logo">Mariusz Andrzejewski</div>
<div id="zegar">12:00:00</div>
<div style="clear:both;"></div>
</div>
<div class="square">
<div class="tile1">1</div>
<div class="tile1">1</div>
<div style="clear: both;"></div>
<div class="tile2">2</div>
<div class="tile3">3</div>
<div style="clear: both;"></div>
<div class="tile4">4</div>
</div>
<div class="square">
<div class="tile5">5</div>
<div class="yt">yt</div>
</div>
<div style= "clear: both;"></div>
<div class="rectangle"></div>
</div>
</body>
</html>
CSS
body
{
background-color: #303030;
color: #ffffff;
font-family: 'Lato', sans-serif;
font-size: 20px;
}
#container
{
width: 1000px;
margin-left: auto;
margin-left: auto;
}
.rectangle
{
width: 960px;
margin: 20px;
}
.square
{
width: 50%;
float: left;
}
#logo
{
float: left;
ffont-family: 'Josefin Sans', sans-serif;
font-size: 40px;
width: 600px;
margin-top: 10px;
margin-bottom 10 px;
}
#zegar
{
float: left;
font-family: 'Josefin Sans', sans-serif;
font-size: 40px;
margin-top: 10px;
margin-bottom 10 px;
}
.tile1
{
float:left;
width:230px;
margin: 10px;
height: 142px;
background-color: #3095d3;
}
.tile2
{
float:left;
width:230px;
margin: 10px;
height: 142px;
background-color: #666666;
}
.tile3
{
float:left;
width:230px;
margin: 10px;
height: 142px;
background-color: #93c748;
}
.tile4
{
float:left;
width:480px;
margin: 10px;
height: 142px;
background-color: #ee5a32;
}
.tile5
{
background-color: #666666;
width: 480px;
margin: 10px;
height: 304px;
}
.yt
{
width: 105px;
margin: 10px;
height: 142px;
background-color: #93c748;
float: left;
}
Pytania mam dwa.
1.Dlaczego <div class="yt"> potrzebuje w CSS zapisu float: left; skoro jest pierwszym elementem z lewej strony...i tu pojawia się pytanie
2Dlaczego po usunięciu float left div idzie o 10px (tak myślę) do góry.Przecież w CSS ma dodany margin 10px i div nad nim tj. <div class="tile5" też ma 10 px margin.
Przyznam,że trochę tego nie rozumiem a ....wolał bym to zrozumieć..