Jump to content

How to enlarge image for mobile device


newcoder1010

Recommended Posts

Hi,

 

I have the below code for desktop version:

       .navbar .logo {    margin-right: -15px;    padding-left: 15px;    padding-right: 15px;}  

When I view the site in mobile, I want to make the logo 100% width. So, logo takes the entire screen.

  @media only screen and (max-width: 500px) {       .navbar .logo {       width:200%;       margin: 0px;       padding: 0px;}  }

It still does not work in mobile. Logo does not take entire screen. Can you please help?

 

 

 

 

 

Link to comment
Share on other sites

You need to apply the style to the image, not the link, because the link is an inline element that can't have a width.

.navbar-header .logo img {  width: 100%;  height: auto;}
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...