Я хотел создать веб-сайт с тремя картинками, которые были бы с правой стороны экрана, при этом текст был бы с левой стороны от него. Проблема в том, что, хотя я правильно установил float:right;
, текст отталкивает изображения вниз.
body {
background: #1a0000;
padding: 10px;
}
img {
width: 300px;
height: 150px;
}
h1 {
padding-top: 30px;
font-size: 40px;
font-family: "Comic Sans MS", cursive, sans-serif;
color: #b30000;
}
.txt {
padding: 0;
}
.logo {
border-top: 10px solid #b30000;
border-bottom: 10px solid #b30000;
}
.floatleft {
display: :block;
float: left;
}
.floatright {
display: block;
float: right;
}
.clanok {
color: white;
font-size: 20px;
}
.txt {
text-align: left;
}
article :first-child {
font-size: 20px;
}
.sd {
float: right;
padding-bottom: 10px;
clear: both;
border: 5px solid #b30000;
max-width: 300px;
max-height: 400px;
overflow: scroll;
}
.sd img {
display: block;
}
<!DOCTYPE html>
<html>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="css.css">
<head>
<title>Dota 2 demonology</title>
</head>
<body>
<div class="logo">
<img src="dota2.png" class="floatleft">
<h1>Demonologia v Doto2</h1>
</div>
<div class="clanok">
<article>
<p>
Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some
text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text
</p>
<aside class="sd floatright">
<q>
<img src="sd.jpg">
Shadow Demon <br>
Some text Some text Some text Some text Some text Some text Some text Some text
</q>
</aside>
<aside class="sd floatright">
<q>
<img src="sf.png">
Shadow Fiend <br>
Some text Some text Some text Some text Some text Some text
</q>
</aside>
<aside class="sd floatright">
<q>
<img src="doom.jpg">
Doom <br>
Some text Some text Some text Some text Some text Some text Some text
</q>
</aside>
</article>
</div>
</body>
</html>