Jak wyrównać elementy poziomo w CSS
.row {
width: 100%;
display: flex;
flex-direction: row;
justify-content: center;
}
.block {
width: 100px;
}
Stupid Sandpiper
.row {
width: 100%;
display: flex;
flex-direction: row;
justify-content: center;
}
.block {
width: 100px;
}
div {
margin-left: auto;
margin-right: 0;
}
/* For horizontal align: */
parent-element {text-align:center;}
/* For horizontal and vertical align: */
parent-element {position: relative;}
element-to-be-centered {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
}
/* See https://www.w3schools.com/css/css_align.asp for more info */
#cTask {
background-color: lightgreen;
}
#button {
position: relative;
float: right;
}
#addEventForm {
position: relative;
float: right;
border: 2px solid #003B62;
font-family: verdana;
background-color: #B5CFE0;
padding-left: 10px;
}
div
{
display:flex;
align-items:center;
justify-content:center;
}
<div class="row">
<div class="block">Lorem</div>
<div class="block">Ipsum</div>
<div class="block">Dolor</div>
</div>