Two borders in CSS

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • maralfarshadi
    New Member
    • Jul 2007
    • 14

    #1

    Two borders in CSS

    Hello

    I have used the following to draw a box in CSS:

    Code:
    #mybox {
    border-style: solid;
    border-width: 10px;
    border-color: #ff0000;}
    Now I want to add a thin black border just around this red box , but could not figure it out. Could you please help me ?


    Thank you in advance
  • nitinpatel1117
    New Member
    • Jun 2007
    • 111

    #2
    add another box around this box and give that box a black border

    call it say #mybox2

    and then in your html

    [HTML]<div id="mybox2">
    <div id="mybox">

    </div>

    </div>[/HTML]

    you may have to add margin to the #mybox div if you want a space between the borders

    Comment

    • drhowarddrfine
      Recognized Expert Expert
      • Sep 2006
      • 7434

      #3
      <div> is for structure, not presentation.
      [code=css]
      #mybox {
      border-style: solid;
      border-width: 10px;
      border-color: #ff0000;
      outline:1px solid black;
      }[/code]

      Comment

      • nitinpatel1117
        New Member
        • Jun 2007
        • 111

        #4
        totally agree with your statement.

        But i don't think IE has full support for this yet

        Comment

        • drhowarddrfine
          Recognized Expert Expert
          • Sep 2006
          • 7434

          #5
          Whoops! You are correct.

          Comment

          Working...