Zaloguj | Zarejestruj | FAQ
Anonymous

Struggling with Float

+ Odpowiedz

Posty: 2 Strona 1 z 1


Struggling with Float

przez greywolf359 » So sie 17, 2013 8:00 pm

So I am very new to css and struggling to understand how to use float. I made three boxes here and I am trying to get them side by side. I thought the float was suppose to allow them to move up next to each other but that is not happening. Instead the second just moves up into the first and overlaps it. Any help to explain why this is happening would be appreciated.

<!doctype html>

<html>

<head>



<style>



div.blockelement{
width: 250px;
border: 5px solid gray;
margin: 10px;
padding: 10px;
float: left;
}

div.blockelement2{
width: 250px;
border: 5px solid gray;
margin: 10px;
padding: 10px;

}

div.blockelement3{
width: 250px;
border: 5px solid gray;
margin: 10px;
padding: 10px;
clear: left;
}
</style>

</head>

<body>

<div class="blockelement">
This is an element1.
</div>


<div class="blockelement2">
This is an element2.
</div>

<div class="blockelement3">
This is an element3.
</div>
</body>
</html>
Avatar użytkownika

greywolf359

  • Posty: 6
  • Dołączył(a): So sie 17, 2013 7:18 pm

Re: Struggling with Float

przez greywolf359 » N sie 18, 2013 5:56 am

Awesome! It worked! Thanks for your help.
Avatar użytkownika

greywolf359

  • Posty: 6
  • Dołączył(a): So sie 17, 2013 7:18 pm


+ Odpowiedz

Strona 1 z 1