Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1000605
    adagency2013
    Participant

    I am trying to create different setting for my site in different devices.
    here I have a code for my header’s logo, but it does not quite work.
    It works for 1100px and up.
    But does not work for Mobile phone 360px till 680px
    neither works tablet 760 to 1099.
    Can you suggest a solution.
    Basically I want the logo image to adjust to the screen size in different devices.
    Thanks

    http://e64.39f.myftpupload.com/

    @media only screen and (min-width: 1100px) {
      .logo-image{
    margin-left:100px;width:85px;display:inline;
      }
    }
    @media 
      (min-device-width: 360px) 
      and (max-device-width: 680px) {
       { 
        .logo-image{
    margin-left:0px;width:50% ;display:inline;
      }
       } 
    
    @media 
      (min-device-width: 760px) 
      and (max-device-width: 1099px) {
         .logo-image{
    margin-left:0px;width:60% ;display:inline;
      }
       } 
    #1000613
    adagency2013
    Participant

    Also, I added this into customizer custom css.
    However it’s been a while I no code will work in my child theme css.
    I’ll enter the login beelow so can you look at it and find out why. The other child theme files work fine.
    Thanks

    #1000614
    adagency2013
    Participant
    This reply has been marked as private.
    #1000873
    Nabeel A
    Moderator

    Hi there,

    Thank you for writing in! Please replace your code with this one:

    
    @media screen and (min-width: 1100px) {
      .logo-image{
         margin-left:100px;width:85px;display:inline;
      }
    }
    @media screen and (min-width: 360px) and (max-width: 680px) {
        .logo-image{
          margin-left:0px;width:50% ;display:inline;
      }
    } 
    
    @media screen and (min-width: 760px) and (max-device-width: 1099px) {
      .logo-image{
         margin-left:0px;
         width:60% ;
         display:inline;
      }
    } 

    Let us know how this goes!

    #1001792
    adagency2013
    Participant

    I tested it and below is how my code looks like for testing it. The first three work, but not the last one which does not work for tablets in portrait mode, with or without an orientation clause.(I also added a border color to recognize between them here http://quirktools.com/screenfly/#u=http%3A//e64.39f.myftpupload.com/psoriasis-treatment/&w=533&h=320&a=34&s=1

    @media screen and (min-width: 1100px) {
      .logo-image{
         margin-left:100px;width:85px;display:inline;
      }
    }
    @media screen and (min-width: 300px) and (max-width: 480px) {
        .logo-image{
          margin-left:0px;width:50% ;  border:green 1px solid;
      }
    } 
    
    @media screen and (min-width: 480px) and (max-width: 680px) {
        .logo-image{
          margin-left:0px;width:100% ;  border:black 1px solid;
      }
    } 
    
    @media screen and (min-width: 760px) and (max-device-width: 1099px) and (orientation: landscape) { ... } {
      .logo-image{
         margin-left:0px;
         width:50%;
       border:red 1px solid;
      
      }
    } 
    #1002242
    Rad
    Moderator

    Hi there,

    The last one should be like this,

    
    @media screen and (min-width: 760px) and (max-device-width: 1099px) {
      .logo-image{
         margin-left:0px;
         width:50%;
       border:red 1px solid;
      
      }
    } 

    This one { ... } also breaks it. Cheers!

    #1002599
    adagency2013
    Participant

    It does not work with or without.
    Please see here http://quirktools.com/screenfly/#u=http%3A//e64.39f.myftpupload.com/psoriasis-treatment/&w=533&h=320&a=34&s=1

    Also see attached screenshot of the tablet view in landscape.
    Please observe that the test border style does not show at all, so no style is taking effect.

    #1002719
    Christopher
    Moderator

    Hi there,

    Upon checking your site, CSS code was applying fine, see the attachment.

    Please clear cache and test again.

    Thanks.

    #1003271
    adagency2013
    Participant

    Yes in the “portrait” orientation is working fine.
    As I mentioned and showed in the attachement in my last reply, the issue is in the “landscape mode”
    Here is the attachment again.

    #1003551
    Rad
    Moderator

    Hi there,

    The problem with device simulation is it’s not actually simulating the orientation the same as on a real device. It only changes the dimension to make it looks like on landscape or portrait.

    Accordion to your screenshot that it should be smaller right? But it’s already small on my end. Should it be bigger?

    Thanks!

    #1003558
    adagency2013
    Participant

    What software are you using to simulate it?

    #1003613
    Rue Nel
    Moderator

    Hello There,

    We are just using Chrome Dev Tools. To know more how you can disable or enable this feature in Chrome, please check the documentation here: https://developers.google.com/web/tools/chrome-devtools/iterate/device-mode/?hl=en

    Hope this helps.

    #1003838
    adagency2013
    Participant

    Thanks. So you are saying Chrome software simulates more truly than quirk tools?

    #1003906
    Rupok
    Member

    Hi there,

    Thanks for updating. Chrome DevTools is the best developers tools out there and have most accuracy.

    Cheers!

  • <script> jQuery(function($){ $("#no-reply-1000605 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>