SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Evangelist Barnum's Avatar
    Join Date
    Oct 2008
    Posts
    418
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Getting rid of border image

    How do I get rid of the border around the UK flag on this page.....?


    C:\Users\Dick\Documents\pugbugmusings\Malamute.html

    Thanks,

  2. #2
    Community Advisor silver trophybronze trophy
    dresden_phoenix's Avatar
    Join Date
    Jun 2008
    Location
    Madison, WI
    Posts
    2,791
    Mentioned
    34 Post(s)
    Tagged
    2 Thread(s)
    Barnum,No one will be able to see your code as you have provided a linking to a file directly on your machine ( and not on the internet) :/


    Chances are you have an anchor (link) tag around your image, many browsers' default setting put a border around image links. You can reset this by putting the following declaration in your CSS file: a img {border:none;}


    Hope that helps.

  3. #3
    Sploghm bronze trophy Victorinox's Avatar
    Join Date
    Nov 2008
    Posts
    749
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    This appears to be the page online:

    http://stoutstandards.com/Malamute.html

    The border is being applied by this in the embedded style sheet:

    Code CSS:
    img {
       border: 4px solid black;
       margin: 10px;
       padding: 0px;
       }
    If you need to apply one-off styling either to a single element or similar elements that may occur throughout your site (such as flag images) then you could create a new class with an appropriate name e.g.

    Code CSS:
    .flag-pic {
        border: none;
    }
    And add the class to the img element:

    Code HTML4Strict:
    <img class="flag-pic" src="images/UKflag.gif" width="200" Height="100">
    Alternatively, if it's likely that borders will need to be overridden on a range of different elements, you could use a class name that reflects this single purpose e.g. .no-border

  4. #4
    SitePoint Evangelist Barnum's Avatar
    Join Date
    Oct 2008
    Posts
    418
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Thank you....did the latter and it worked. Appreciate your help.

  5. #5
    om nom nom nom Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,271
    Mentioned
    50 Post(s)
    Tagged
    2 Thread(s)
    many browsers' default setting put a border around image links.
    I'm still looking for this elusive browser. Many put borders around all images, but I haven't found one who cared about links yet. Instead, the img border just gets turned blue instead of black or whatever.

    img {
    border: 0;
    }
    ought to remove the borders from all images in all non-neolithic browsers (but if there is a neolithic browser who only goes after a img's, I want to find it. You know, hunt it down, kill the last of its kind, skin it and hang its head proudly above my mantel. Then I can gaze at it smugly while reclining in my smoking jacket in my eared highback chair made from the bones of my enemies, and puff on my Cuban cigar while sipping brandy)

  6. #6
    Community Advisor silver trophybronze trophy
    dresden_phoenix's Avatar
    Join Date
    Jun 2008
    Location
    Madison, WI
    Posts
    2,791
    Mentioned
    34 Post(s)
    Tagged
    2 Thread(s)
    Stommey!!!!
    I'm still looking for this elusive browser.
    FF on mac, but... I like FF and I love macs so.

    Now that I can see Barnum's code -- --- I realize that the best way is to assign a class or ID since he's overriding a set style for all images anyway.
    [ACTUALLY I would recode the whole page and since the image would probably be the only image in the masthead use .masthead img. Just a tip ]

  7. #7
    om nom nom nom Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,271
    Mentioned
    50 Post(s)
    Tagged
    2 Thread(s)
    FF on mac sets no default border on img but does set a border on a img?

    Okay, readying my shotgun and horses and the hounds...


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
  •