Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Mar 2013
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts

    How to change CSS to attribute selectors

    Hi,

    I've created a responsive HTML email and discovered that some elements dont render correctly in Yahoo mail. I've looked on blogs and I understand that I need to use attribute selectors to get it to work.

    I know what they are but have never written any code with it and am confused how to change most of them to this way.

    Can you please help? Code is below.

    Code:
      
     @media screen and (max-width: 768px) {
        .menu>li {
        width: 25 !important; 
        margin-bottom:5px !important;
        }
        .menu>li:hover > ul {
        display: none !important;
        }
        }
        @media screen and (max-width: 480px) {
        .menu>li {
        position: static !important;
        width: 100% !important;
        margin-bottom:5px !important;
        }
        .menu li a {
        border: none !important;
        }
        .menu>li:hover > ul {
        display: block !important;
        }
    
        .menu .end {
        position: static !important;
        width: 100% !important;
        }
    	    }
    Thanks.

  • #2
    Regular Coder
    Join Date
    Jun 2011
    Location
    CA
    Posts
    105
    Thanks
    0
    Thanked 10 Times in 10 Posts
    Why exactly do you think switching to attribute selectors will do the job?


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •