Click here to Skip to main content
15,888,527 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to center the logo under 990 px device using media queries. But unable to get it.
CSS
.logo5 img {
margin-top: 10px;
max-width: 150px;
height: 120px;
float: left;
}

@media (max-width: 990px){
	.logo5 {
	width: 100%;
  }
}


What I have tried:

<div class="logo5">
					<img src="images/logo.png">
					</div>
Posted
Updated 8-Jun-20 3:32am

 
Share this answer
 
If you want it horizontally centered, don't float it.
CSS
.logo5 img {
    max-width: 150px;
    max-height: 120px;
    margin: 10px auto 0;
}

@media (max-width: 990px){
    .logo5 img {
        max-width: 100%;
    }
}
margin - CSS: Cascading Style Sheets | MDN[^]
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900