Okay
  Public Ticket #160116
Forcing some elements full width with CSS
Closed

Comments

  • Nathan started the conversation

    Hi,

    I'm trying to force certain images and divs to go full width under 1000px. I've figured out how to apply this to the featured image on a blog post, and also the author bio at the bottom of the post: Although this only seems to work under 690px even though I've applied it for under 1000px. Any tips on how to implement this better?

    See here for example:

    @media only screen and (min-width : 1px) and (max-width : 1000px) {
         article.post .content-inner .post-featured-img img {
              width:120%;
              margin-left:-10%;
         }
    }

    http://nathanmfarrugia.com/blog/are-ebooks-really-the-future-of-writing-the-telegraph/

    Currently works a treat under 650px width.

    Thanks!

    Nathan

  •  1,069
    ThemeNectar replied

    Hey!

    try changing it to:

    @media only screen and (min-width : 1px) and (max-width : 1000px) {
         body article.post .content-inner .post-featured-img img {
              width:120%!important;
              margin-left:-10%!important;
         }
    }

     

  • Nathan replied

    Amazing, thank you!

    It still messed up over 680px but this time I only had to increase the size from 120% to 130%:

    @media only screen and (min-width : 1px) and (max-width : 680px) {
         body article.post .content-inner .post-featured-img img {
              width:120%!important;
              margin-left:-10%!important;
         }
    }
    
    @media only screen and (min-width : 680px) and (max-width : 1000px) {
         body article.post .content-inner .post-featured-img img {
              width:130%!important;
              margin-left:-15%!important;
         }
    }