<!DOCTYPE html>
<html lang="pl">
<head>
<meta charset="UTF-8">
<title>Nawigacja</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<header></header>
<main>
<div class="left">
<p>LEWY</p>
</div>
<div class="right">
<p>PRAWY</p>
</div>
</main>
<footer></footer>
</body></html>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-size: 42px;
}
body {
display: flex;
flex-direction: column;
align-items: stretch;
background-color: lightcoral;
min-height: 100vh;
}
header {
background-color: antiquewhite;
flex-basis: 20vh;
}
main {
background-color: blue;
flex-grow: 1;
display: flex;
}
footer {
background-color: orange;
flex-basis: 10vh;
}
.left {
background-color: silver;
flex-grow: 1;
display: flex;
align-items: center;
justify-content: center;
}
.right {
background-color: dimgray;
flex-basis: 30%;
position: relative;
}
.right p {
position: absolute;
left: 50%;
top: 50%;
}
Prosty layout strony zrobiony za pomocą flexboxa.
Jaki jest najlepszy sposób na stylizowanie, wyśrodkowanie tekstu, ikon, grafik wewnątrz takiego layoutu?
W lewej klasie użyłem ponownie flexboxa. W prawej klasie position.