Inner border for a div?

Hi,

Is there any tag for creating a 1px inner border for a div? I know we have the normal border itself, anything for an inner border? If not, what's the simplest way to get such an effect?

Thanks
LVL 7
minnirokAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

BogoJokerCommented:
Hi minnirok,

I think this might be a little crude but how about a little border div:
[html]
<div id="main">
  <div id="border">
  ...
  </div>
</div>

The style of the border domain giving a slight padding and the border
[css]
div.border
{
  padding: 1px;
  border: 1px solid black;
}

I don' think that is what you want but its a suggestion.

Joe P
0
BogoJokerCommented:
instead of padding it shold probably be margin: 0;
0
minnirokAuthor Commented:
That could work, I was thinking I'd have to do this since I've never seen an inner border style attribute. I'm trying to change the border color dynamically with javascript, and this works in IE:

    document.getElementById("div_5").style.borderWidth = '2';
    document.getElementById("div_5").style.borderColor = 'red';

No luck in firefox, any ideas?

Thanks
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

BogoJokerCommented:
That should work, just it should be:
document.getElementById("div_5").style.border-width = '2';
document.getElementById("div_5").style.border-color= 'red';

Here is a good source for all the tags:
http://www.w3schools.com/css/css_reference.asp#border
Notice that it moves you right to the border CSS attributes on that page, but that should be ALL CSS2 thingies

=)
Joe P
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
BogoJokerCommented:
That border-width should probably have units:
2px
I tryed to fix it before I submitted, apparently not =)
0
minnirokAuthor Commented:
aweseome thanks as always
0
BogoJokerCommented:
No problem =)

Joe P

Note: Although the comment you accepted was good, try to accept the comment that was the answer to the question, [int his case probably the first comment], that way if someone searchs the site in the furute, they will find the same solution.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
HTML

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.