Ahojte,
v ramci jedneho kurzu mam nieco ako domacu ulohu. Mal by som vytvorit nieco taketo:
https://d17oy1vhnax1f7.cloudfront.net/items/3Q3B0N0y1w1w1Z2G3N3M/blog-3.png a malo by to byt pomocou floatov.
Momentalne mam:
<body>
<header>
<h1>DARING FIREBALL</h1>
</header>
<main>
<aside class="navigation">
<ul>
<li><a href="#"></a>ARCHIVE</li>
<li><a href="#"></a>THE TALK SHOW</li>
<li><a href="#"></a>$2.99 - VESPER</li>
<li><a href="#"></a>PROJECTS</li>
<li><a href="#"></a>CONTACT</li>
<li><a href="#"></a>COLOPHON</li>
</ul>
</aside>
<article>
<header>Tim Cook: "I'm Proud to Be Gay"</header>
<h1>Tim Cook, writting in Bussinessweek</h1>
<div class=articleContent>
<p>Caramels ice cream liquorice ice cream chocolate cake donut cookie bear claw. Cookie chocolate cake pie fruitcake sweet. Gingerbread powder liquorice croissant tiramisu donut. Macaroon macaroon candy marshmallow jujubes jelly brownie halvah.</p>
<p>Ice cream muffin chocolate chocolate cake cupcake pie chocolate cake. Cookie sugar plum lemon drops cake I love I love. Pudding jelly-o pie lemon drops oat cake. I love soufflé jelly beans.</p>
</div>
</article>
</main>
<footer>
</footer>
</body>
a
body{
width: 60%;
margin: 0 auto;
}
.navigation{
float: left;
width: 15%;
outline: 2px solid green;
}
.navigation ul{
list-style-type: none;
}
article header{
color: red;
}
article h1{
}
article .articleContent{
border-left: 1px solid black;
outline: 2px solid red;
}
Vysledkom je nieco taketo:
Problem je ten, ze ten cerveny div "overflowne" ten zeleny a ten lavy border ktory sa tam snazim vykuzlit je tym padom uplne vlavo. Problem je asi ten, ze ak to chapem spravne, floatovany element sa umietnuje relativne, resp stale ostava v document flowe.Riesenim by bolo floatnut ten cerveny div vpravo a nastavit mu sirku. Je to spravny postup, alebo sa to da robit inteligentnejsie ? Mam totiz radsej ked sa veci nastavuju automaticky a dopocitavaju sa nez im nastavovat nieco napevno.
Dakujem