Jump to content
MakeWebGames

border around a border


PHPDevil

Recommended Posts

Hey, back again :)

Just wondering if I had a div like this

 

.example
{
border-style: solid;
color: red;
}

 

now as you can see around the div theres a red border. Is it possible to have another border around that red border without having to make another div tag.

Because what I have at the momment is a black box, red border but i want another black border around it as it might look nice!

Link to comment
Share on other sites

you can do it with css3 but not every browser supports it

http://www.css3.info/preview/outline/

[css]outline: 1px solid #000000;[/css]

Or box-shadow. :)

[css]

.example {

border: 1px solid #000;

box-shadow: inset 0px 0px 0px 1px red;

}

[/css]

Or reverse (in-case CSS3 method not supported, it isn't black on black.)

[css]

.example {

border: 1px solid red;

box-shadow: 0px 0px 0px 1px #000;

}

[/css]

Edited by Djkanna
Added "Reverse"
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...