I’m trying to replicate the following layout. However, I failed to align the texts with their corresponding icons.
This is what I tried:
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title>Guia de Pesca Santos</title>
<style>
p {
font-size: min(max(5px, 4vw), 30px);
text-align: center;
}
/*img,p { display: inline-block; }*/
.contenedor {
display: flex;
align-items: center;
display: inline-block;
}
img {
width: 30px;
}
</style>
<meta name="viewport" content="width=device-width" , initial-scale=1.0, maxime-scale=1.0>
</head>
<body>
<div class="contenedor">
<img src="img/icotelefone.png" alt="Telefone">
<p>+55(13) 9779-0227 -Daniel- </p>
<img src="img/icoemail.png" alt="Telefone">
<p> [email protected] </p>
</div>
</body>
</html>
What should I do in order to make it work?
2
Answers
to align the fileds data give some fixed width to using class or id and use text-align property.then you can accomplish your task.
If you want to retain a flat HTML structure, you could replace flexbox with grid and define templated columns, for instance