1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

CSS linked Image borders

Discussion in 'CSS' started by Doug E, Aug 10, 2005.

  1. #1
    I can't figure out how to control the colour of a border around a linked image with css. Firefox, of course, reads it how I want, but IE (the bastages) is picky.

    I just found this board after surfing for hour for an answer but my head is spinning now as I'm sick and I just want a damn white border around this image for all my IE using surfers. :cool:

    Any advice would be appreciated, thanks :)
     
    Doug E, Aug 10, 2005 IP
  2. SEbasic

    SEbasic Peon

    Messages:
    6,317
    Likes Received:
    318
    Best Answers:
    0
    Trophy Points:
    0
    #2
    img {
    border: none;
    }
     
    SEbasic, Aug 10, 2005 IP
  3. Doug E

    Doug E Peon

    Messages:
    8
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    that put me in the right direction, thanks.

    new question,

    I want to make more than one font size for each paragraph. how can i do this ? is there something similar to the <H1> tags where i can change each <Hx> font size in my document head.

    p1 {font-size: 15px }
    p2 {font-size: 20px }

    etc.
     
    Doug E, Aug 11, 2005 IP
  4. SEbasic

    SEbasic Peon

    Messages:
    6,317
    Likes Received:
    318
    Best Answers:
    0
    Trophy Points:
    0
    #4
    <p class="name">Copy</p>

    .name {
    Style info
    }

    (As a side note, you should use % or em for the font size instrad of px as it allows the text size to be changed by the browser)...
     
    SEbasic, Aug 11, 2005 IP
  5. Doug E

    Doug E Peon

    Messages:
    8
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    thanks again man!

    I'll look into the %, It was recomended i use px in a tutorial, or I took it that way, as my sites have tables with little to no room for adjustment in size.
     
    Doug E, Aug 11, 2005 IP
  6. Doug E

    Doug E Peon

    Messages:
    8
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    so this leaves me with question #3.

    can I do the same with links or do they all have to be by the same color I set in my css file?
     
    Doug E, Aug 12, 2005 IP
  7. SEbasic

    SEbasic Peon

    Messages:
    6,317
    Likes Received:
    318
    Best Answers:
    0
    Trophy Points:
    0
    #7
    You can apply a class to most HTML elements and then reference them in your css file accordingly.
     
    SEbasic, Aug 12, 2005 IP
  8. Doug E

    Doug E Peon

    Messages:
    8
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    cool! thanks SEbasic. Ive been practising the class system, its pretty useful.

    CSS is sweet, a little more studying and I can be rid of tables forever :)
     
    Doug E, Aug 13, 2005 IP
  9. Doug E

    Doug E Peon

    Messages:
    8
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Im now having problems with DIVs and finding IE and Firefox dont register the code the same. Ive got it all tweaked for FF but it looks like garbage in IE. Are there any tutorials you guys know that can explain why this is and how I can fix things up ?

    Oh, my problem is the positioning. Widths heights and top. I do it all in pixels and each DIV is set to stay in position (absolute)
     
    Doug E, Aug 26, 2005 IP
  10. SEbasic

    SEbasic Peon

    Messages:
    6,317
    Likes Received:
    318
    Best Answers:
    0
    Trophy Points:
    0
    #10
    No tutorial to hand, but if you put this in the header of your pages

    <!--[if gte IE 5]>
    <link rel="stylesheet" href="styles/ie.css" type="text/css" />
    <![endif]-->

    Then you can have a stylesheet specifically for ie...

    The normal style will be read first, then this - so you only need to add style changes for the styles you want overwritten in ie.

    It's a really handy bit of code.
     
    SEbasic, Aug 26, 2005 IP
  11. Doug E

    Doug E Peon

    Messages:
    8
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #11
    very interesting code indeed. Now I can treat FF users to a better experience and discriminate against IE users by giving them a boring ass page to look at :)

    Much appreciated , thanks again SE!
     
    Doug E, Aug 29, 2005 IP
  12. nevetS

    nevetS Evolving Dragon

    Messages:
    2,544
    Likes Received:
    211
    Best Answers:
    0
    Trophy Points:
    135
    #12
    IE has a different box model than firefox and that causes layout problems for a lot of people. http://www.meyerweb.com/eric/css/ is a good link. I have a couple of his books, and you can get a good portion of the info from the books on his websites. As you get deeper into css you'll find that IE has a lot of issues accross various versions of the browser and there are a lot of documented hacks out there that are pretty standard. They only really come into play when you are doing something relatively complex for the most part. IE isn't the only culprit of problems that you'll eventually have to work around. Safari, Opera, IE on the Mac have all given me problems at one time or another.

    You should check out the web developers toolbar for firefox. It lets you make edits to css files in realtime and see what the results are - which is really helpful if you are playing with font sizes or pixel sizing something and want to play around with different values.
     
    nevetS, Aug 29, 2005 IP