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?
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> Code (markup): it will actually have 102x102 pixels in FF and 100x100 in IE. Internet Explorer is always the most troublesome...
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.
when you apply a border to a exact width and height.. it really adds if 2px border, all in all will be 102px