How can i move my logo to top left side in the header


This Content is from Stack Overflow. Question asked by Muhammed Nishad

Iam desiging an header for my college project which the logo is supposed to come in the top left corner.i have tried by using float property in css but it did not make reflection. How can I shift my logo to top left side in the header bar? I tried most of the time but code is not executed.
My HTML code and CSS code is below:

<!DOCTYPE html>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="css/style.css">
    <header class="header">
    <img class="logo" src="img/pharmapp.png" alt="logo">
    <p class="p">Medcines on your Doorstep</p>
    <nav class="nav__links">
        <li><a href="#">Login</a></li>
        <li><a href="#">SignUp</a></li>
        <li><a href="#">About</a></li>
    <a class="cta" href="#" <button>Contact</button></a>



@import url(' 
box-sizing: border-box;
margin: 0;
padding: 0;
li, a, button {
font-family:"Montserrat", sans-serif;
font-weight: 500;
font-size: 16px;
color: #000000;
text-decoration: none;

display: flex;
align-items: center;
padding:30px 10%;
background:linear-gradient(rgba(165, 246, 144, 0.3) 0%,
rgba(158, 249, 216, 0.63)  100%);
height: 56px;
position: absolute;
width: 584px;
height: 67px;
left: 232px;
top: 25px;
text-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
background: url(pharmapp.png);
align-items: center;
font-family: 'Montserrat';
font-style: italic;
font-weight: 400;
font-size: 16px;
line-height: 34px;

color: #000000;

position: relative;
float: left;
background: url(pharmapp.png);
height: 122px;
left: 20px;
bottom: 40px;


This question is not yet answered, be the first one who answer using the comment. Later the confirmed answer will be published as the solution.

This Question and Answer are collected from stackoverflow and tested by JTuto community, is licensed under the terms of CC BY-SA 2.5. - CC BY-SA 3.0. - CC BY-SA 4.0.

people found this article helpful. What about you?