View Full Version : Quick Question
oo7ml
Nov 14th 2007, 12:09 pm
Lets say i have a DIV and i set the height to 100px and the width 100px and i apply a border to it of 2px. Now lets say i want to put an image in this DIV to fill it, should the image be 100px X 100px or should it be 98px X 98px to allow for the boder...
I guess what i am asking is:
When a border is applied to a an element such as a DIV or TABLE etc... does the border go on the outside of the element or the inside or where does it go?
IngaOz
Nov 14th 2007, 12:15 pm
I believe you can make that image 100% (no pixels) or if you need pixels then 98x98px.
Dwaighty
Nov 14th 2007, 12:19 pm
It differs from browser to browser. Firefox will add the border outsite those 100px, but IE won't. So if you have this piece of code:
<div style="width: 100px;height: 100px;border: 2px solid black;background:blue;">
</div>
it will actually have 102x102 pixels in FF and 100x100 in IE. Internet Explorer is always the most troublesome...
oo7ml
Nov 14th 2007, 1:35 pm
Wow, i thought i was asking a very stupid question but that is very interesting... thanks guys
BackOfTheNet
Nov 15th 2007, 3:00 am
IE is rubbish well 6.0 ++ anyway lol The latest version 7.0 ++ reads the pages juts like firefox now yay!!!
A good idea is to display Firefox referral banners from adsense on your pages and display that your site functions better in firefox you may earn a few $ for your troubles.
xsabrina.chic
Nov 15th 2007, 6:08 am
when you apply a border to a exact width and height.. it really adds if 2px border, all in all will be 102px :)
vBulletin® v3.6.8, Copyright ©2000-2008, Jelsoft Enterprises Ltd.