Results 1 to 3 of 3

Thread: [RESOLVED] CSS - positioning an image

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Jun 2001
    Location
    Trafalgar, IN
    Posts
    4,141

    Resolved [RESOLVED] CSS - positioning an image

    I'm looking for the proper css to produce a div like the attachment.

    So far I have

    Code:
    .archive
    { 
    BACKGROUND-IMAGE: url(file://C:\Documents and Settings\Mark\Desktop\outdated.gif);
    background-repeat: no-repeat;
    Padding-LEFT: 32px;
    BACKGROUND-COLOR: silver;
    BORDER: gray 2px solid;
    WIDTH: 200px;
    }
    This is getting close. In IE it is placing the imagae in the upper left corner. In FireFox I'm not seeing the image. I would like to position the image a few pixels in and a few pixels down. Can someone help me with the positioning?
    Attached Images Attached Images  

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,173

    Re: CSS - positioning an image

    Firefox probably isn't picking up on the spaces too well, so replace them so that your file path looks like this

    Code:
    file:///C:/Documents%20and%20Settings/Mark/Desktop/outdated.gif
    As for the positioning, maybe you should consider placing the image in the DIV itself or giving a little more space on the top and left to the image itself.

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Jun 2001
    Location
    Trafalgar, IN
    Posts
    4,141

    Re: CSS - positioning an image

    It was the spaces that were the problem with Firefox. This is what I ended up with and it seems to work.

    Thanks
    Code:
    .archive
    { 
    BACKGROUND-IMAGE: url(file:///C:/Documents%20and%20Settings/Mark/Desktop/outdated.gif);
    background-repeat: no-repeat;
    BACKGROUND-POSITION: 5px center;
    Padding-LEFT: 35px;
    Padding-Right: 5px;
    BACKGROUND-COLOR: silver;
    BORDER: gray 2px solid;
    WIDTH: 200px;
    FONT-FAMILY: Arial, Verdana, 'Times New Roman';
    FONT-SIZE: 8pt;
    }

Posting Permissions

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



Click Here to Expand Forum to Full Width