goldenbuckles Posted November 23, 2009 Report Share Posted November 23, 2009 (edited) I cannot figure out how to add an outline around my div boxes for my website. I have looked things up, but none seem to work for me. All my div boxes will be outlined with the same html, so a css command is needed also (in order to make it easier). I would like the following as specifications: 2px outline color silver left: 45px width 220px height 150px style solid Can anyone help me out? Edited November 23, 2009 by goldenbuckles Quote Link to comment Share on other sites More sharing options...
jlhaslip Posted November 23, 2009 Report Share Posted November 23, 2009 check here see also the tutorial on borders at that site. Quote Link to comment Share on other sites More sharing options...
goldenbuckles Posted November 23, 2009 Author Report Share Posted November 23, 2009 I tried that one, but the borders/outlines only go around the paragraphs and I need them to outline the div boxes themselves. Any other suggestions? Quote Link to comment Share on other sites More sharing options...
Andrea Posted November 23, 2009 Report Share Posted November 23, 2009 Apply the CSS for the border to the div tag. Do you have a link? Quote Link to comment Share on other sites More sharing options...
Wickham Posted November 23, 2009 Report Share Posted November 23, 2009 (edited) IE6 and IE7 don't support the outline property so you might have to use conditional comments and borders for them, but remember that borders add to the div width while outlines are outside and don't affect the total width. Edit: although the w3schools link says that outline is supported by all major browsers, if you use outline: none; in IE6 or IE7 it doesn't work, so although IE shows the dotted Outline around links, you can't get rid of it. Edit again: just tested IE7; outline doesn't work but Firefox OK. Edited November 23, 2009 by Wickham Quote Link to comment Share on other sites More sharing options...
goldenbuckles Posted November 23, 2009 Author Report Share Posted November 23, 2009 Ok, Andrea yours worked. Any ideas on how to make the border wider then the box? Or should I just make the box bigger? As in width should I make the div bigger or make the border bigger? Quote Link to comment Share on other sites More sharing options...
Wickham Posted November 23, 2009 Report Share Posted November 23, 2009 CSS:- #div-name { border: 2px solid silver; } Most people would leave the div width and height the same and the border adds to the total width and height. Quote Link to comment Share on other sites More sharing options...
goldenbuckles Posted November 23, 2009 Author Report Share Posted November 23, 2009 Yeah I have the border, but now the left side of the border edge butts up against a find product box and I want that moved into the center. I cannot figure out how to center the product box. Quote Link to comment Share on other sites More sharing options...
goldenbuckles Posted November 23, 2009 Author Report Share Posted November 23, 2009 How would I center this find products box? Search Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.