#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2012
    Posts
    156
    Rep Power
    13

    Css background image and colour


    Hi

    I am having a css/html image issue

    I got a static image using a css class called static, on my 1024 screen size it is perfect but on my 1280 screen I want the image to have a background colour of a dark grey that extends further than the image if that makes sense

    I am using css mediaqueries for the larger screen

    I can't work out how to do it, the HTML is below

    Code:
    <img src="images/landlordrefurbstatic4.jpg" alt="" title="" class="static">
    Code:
    /* Media Queries */
     
    @media only screen and (min-width: 1280px) {
     
    .static {
    width: 1120px;
    height: 320px;
    margin: 0 0 0 -67px;
    background: #373737;
    }
     
    }
    Sorry to post again

    Kind regards

    Ian
  2. #2
  3. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2011
    Location
    The Pleiades
    Posts
    300
    Rep Power
    9
    Good afternoon Ian,

    Give it a left padding instead of margin.

    Kind regards,

    NM.

IMN logo majestic logo threadwatch logo seochat tools logo