Results 1 to 5 of 5

Thread: CSS No border around 1 image only help

  1. #1
    Join Date
    Feb 2006
    Posts
    68
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default CSS No border around 1 image only help

    OK this is what I need to do. I have small gifs on my page. I do not want a border around them. So in the style section I put

    img{border:none;}

    That works great.

    However at the bottom is an image and this image is also a "back" button that returns the user to the main page. It is also in a seperate division called "ctr"

    So basically the HTML looks like
    <div class="ctr"
    <a href="index.html">
    <img src="back.gif" alt="back.gif">
    </a>
    </div>

    What I want to do is but a border around that image (which is also a link) and NOT have a border around any other image. I tried a few things but I either wind up with borders around all my links or a border around the class called "ctr" instead of just the image INSIDE of that class.

    If you got any answer I'd appreciate it.

  2. #2
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    Have you tried adding a border declaration to the img src tag?

    Code:
    <img src="back.gif" alt="back.gif" border="1">
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  3. #3
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,496
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Code:
    .ctr img {
    border: 1px solid blue;
    }
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  4. #4
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    Or that
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  5. #5
    Join Date
    Feb 2006
    Posts
    68
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks guys

    Blizzard, of course your way is fine, but I try to keep my pages so they will validate with XHTML. I didn't mention it

    jscheuer1

    Thanks your way worked perfectly.

    I appreciate both your help

    mark

Bookmarks

Posting Permissions

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