Skip to content

Latest commit

 

History

History
39 lines (28 loc) · 586 Bytes

logo-position.md

File metadata and controls

39 lines (28 loc) · 586 Bytes

How to align a logo with absolute positioning

How would you make this logo aligned to the top left corner of the image?

alt text

HTML:

<header class="header">
  <div class="logo-box">
      <img src="img/logo-white.png" class="logo" />
  </div>
</header>

CSS:

.header {
  position: relative;
}

.logo-box {
  position: absolute;
  top: 40px;
  left: 40px;
}

.logo {
  height: 35px;
}

From now on, the base point of the logo is the top left corner of the image.

References: