Hi I have made short section with information about contact; facebook,number,mail. I have two question because I read about float and without clearfix parent of floated element shouldn't has height in my case div.contact has 36px of height. Secondly I would like to center text next to icon how is the fastest way to do it?
.visit {
background-color:black;
padding: 10px 25px;
color: white;
font-family: Saira, sans-serif;
font-weight: normal;
}
.visit img {
height: 36px;
float: left;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<div class="visit">
<div class="contact">
<img src="https://i.postimg.cc/Vk5vJ3w3/contact1.png" alt="mail" />
<span>1231@gmail.com</span>
</div>
<div class="contact">
<img src="https://i.postimg.cc/XYcW7LGT/contact2.png" alt="phone" />
<span>501501501</span>
</div>
<div class="contact">
<img src="https://i.postimg.cc/7Yts12vf/contact3.png" alt="facebook" />
<span>1231</span>
</div>
</div>
</div>
</div>
</section>
<footer></footer>
</body>
</html>