Follow along with the video below to see how to install our site as a web app on your home screen.
Бележка: This feature may not be available in some browsers.
kopura каза:[css]
div {
float:left;
}
[/css]
? :?:
Успех !![]()
<div style="clear:both"></div>
<div class="divcomunity2">
<img src="test.png">
</div>
Само 1 въпрос, това <div style="clear:both">, немогали го сложа в CSS-а и да не се чупят всичките дивове, как се бъват (2ри-въпрос) и защо се чупят.marian каза:Самия код не трябва да го copy/paste, а първо го четеш и взимаш каквото ти трябва т.е. в този случай float:left;.
[css].divcomunity2 {
float:left;
}[/css]
За да не се "счупи" страницата слагай след последния float clear:both; т.е. сложи този код
след посления:HTML:<div style="clear:both"></div>
HTML:<div class="divcomunity2"> <img src="test.png"> </div>
.clear{
clear: both;
}
<div class='clear'></div>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-US" xml:lang="en-US" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=windows-1251"/>
<title>блах-блах-блах</title>
<style>
html, body {
margin: 0;
padding: 0;
}
div.content {
width: 600px;
margin: 0 auto;
}
div.left_box {
background-color: #000;
width: 400px;
float: left;
color: #fff;
padding: 5px;
}
div.right_box {
background-color: #c0c0c0;
width: 180px;
float: left;
color: #fff;
padding: 5px;
}
div.footer {
background-color: red;
clear: both;
width: 590px;
padding: 5px;
}
</style>
</head>
<body>
<div class="content">
<div class="left_box">test</div>
<div class="right_box">test2</div>
<div class="footer">footer</div>
</div>
</body>
</html>