Results 1 to 2 of 2
Thread: White border right side of page
Sep 22, 2011, 18:51 #1
- Join Date
- Sep 2011
- 0 Post(s)
- 0 Thread(s)
White border right side of page
ive always thought that
will remove the default white border around a website
however it is only partly working for me
it works find if i use a background color
however if i try and use a background image there is still a white border
on the right side only
its probably a dumb mistake so let me know please
Sep 22, 2011, 21:33 #2
- Join Date
- Jun 2008
- Madison, WI
- 32 Post(s)
- 1 Thread(s)
Welcome to SitePoint, Mike.
Am afraid you are misconstruing what constitute a border.
Imagine an HTML element, lets say a div, to be a box. margin is a transparent space placed outside said box ( it has subtle nuances as how it interacts with the margins of other elements, but lets keep this explanation simple). Consequently bg images will NOT extend into the margin.
Padding is space added INSIDE the element ( which is why its calculated as element size+ element padding).. as such it will show the bg images set in that element.
Border actually acts just like padding ( really, it does), the only difference is that you can set a color to it, and thus cover up the the background image. if you wanted to show the image, you could use "transparent" as the color, but really for that just use "padding" instead.
OK, I do have to expound on margins...
Margins COLLAPSE, vertically.
That means if you have an element with no margin at the top, for example, and it contains another element with a margin top of 50px; it will be as if your contain element had the 50px margin-top and your contained element had no margin top. In other words it would appear to be a white border. This shouldn't be the case however, if what you see is space to the sides of the element as margin collapse only happens on top and bottom.
I hope this clears things up for you.
If you are still stuck , and post your HTML and CSS code , I can take a quick look.Tips for better/ faster SitePoint forum answers
Brilliant ideas, elegant execution.
Graphic Design, Art Direction, Copywriting and Web Design.