Results 1 to 7 of 7

Thread: Border around a picture [Resolved]

  1. #1

    Thread Starter
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190

    Border around a picture [Resolved]

    I have an image on my page:

    $Bilde = '<img class="bilde" src="' . 'bildebox/' . $Bilde . '" />';


    is it possible to alter the "bilde" class in CSS so I can have a border around the picture, or do I have to make that in Photoshop?
    Last edited by NoteMe; Apr 30th, 2004 at 03:23 PM.

  2. #2
    Don't Panic! Ecniv's Avatar
    Join Date
    Nov 2000
    Location
    Amsterdam...
    Posts
    5,343
    You should be able to alter in the css.

    Depends where else that class is used...

    Try it .. only take 5 secs or so to input and refresh ??


    Vince

    BOFH Now, BOFH Past, Information on duplicates

    Feeling like a fly on the inside of a closed window (Thunk!)
    If I post a lot, it is because I am bored at work! ;D Or stuck...
    * Anything I post can be only my opinion. Advice etc is up to you to persue...

  3. #3

    Thread Starter
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190
    I tried with border:1px; but it didn't help, so was wondering if there was an other property or something, or an other way to do it.....

  4. #4
    Frenzied Member Acidic's Avatar
    Join Date
    Sep 2003
    Location
    UK
    Posts
    1,090
    whats wrong with:
    <img src="me.jpg" border="0" alt="">
    ?
    Have I helped you? Please Rate my posts.

  5. #5

    Thread Starter
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190
    This is no fun...

    I was trying to make a border Acidic, not take it away..

    Yeas it works (just tried it with):

    Code:
    <img src="me.jpg" border="1" alt="">
    But I am doing a lot of other things with the picture too, so I made a class:

    Code:
    img.bilde{
    	margin-right:7px;
    	float:right;
    	z-index:22;
    	visibility: visible;
    	clear:both;
    	border:10;
    	border:1;
    }
    But then the border won't show if I print this:

    Code:
    $Bilde = '<img class="bilde" src="' . 'bildebox/' . $Bilde . '" />';
    And I can't set all the properties I want in the HTML code, like clear="both" and float="right", so then I have to use both a class and set "properties in the HTML tag, and I have heard that it isn't a good solution. Anyone agree about that. Or have a better solution?

  6. #6
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    'border'
    Value: [ <border-width> || <border-style> || <'border-top-color'> ] | inherit
    Initial: see individual properties
    Applies to: all elements
    Inherited: no
    Percentages: N/A
    Media: visual
    Computed value: see individual properties

    The 'border' property is a shorthand property for setting the same width, color, and style for all four borders of a box. Unlike the shorthand 'margin' and 'padding' properties, the 'border' property cannot set different values on the four borders. To do so, one or more of the other border properties must be used.

    Example(s):

    For example, the first rule below is equivalent to the set of four rules shown after it:

    p { border: solid red }
    p {
    border-top: solid red;
    border-right: solid red;
    border-bottom: solid red;
    border-left: solid red
    }
    There's no resource like the spec
    http://www.w3.org/TR/CSS21/


    A full border declaration is for example:
    border: 2px solid #f00;
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  7. #7

    Thread Starter
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190
    I should really start to use those pages and not only trust my really really bad school book in HTML/CSS (written by a GIRl....)

    But I guess it is an art to read those pages too, like the MSDN. But I figgured it out after a while. In Firefox the deafult was a 3px border or something..., but now it looks great. Thanks.

    ØØ

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