Are you first timer at Why not join us and start exchange your programming knowledge with everyone. Register today!

CSS - position alignment

0 votes
added Jul 18 in CSS by LC Marshal Lieutenant (12,590 points)
<!--Vertical align 2 spans in one div-->
<div class="row">
  <span><img src="1.jpg"></span>
  <span>Company name</span>
span {
  display: inline-block;
  vertical-align: middle;
/*centralize position"absolute element*/
margin-left: auto;
margin-right: auto;
left: 0;
right: 0;
/*justify cols without bootstrap*/
#header .desktop-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    height: 60px;
/*Vertical align img*/
img {
  vertical-align: text-top;
/*To justify the text in sentences*/
text-align: justify;
/*Align item to be centralized*/
-webkit-box-align: center;
-webkit-align-items: center;
/*Centralized element vertically and horizontally*/
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);


Please log in or register to response this reference. - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.