Adventures with CSS…

No, that’s not C.S. Lewis, that’s CSS as in Cascading Style Sheets.

I’ve lately been tasked with doing some more web development (not necessarily my forté, but something I have done a little bit of). In working with a particular page layout, I was unable to figure out why I was getting a white border around the page. I kept toying around with various margin and padding settings, but wasn’t able to figure out what was causing it for some time. Being new to CSS, it didn’t really occur to me that I should explicitly be setting things to values of 0. (C# has got me in a habit of relying on things being zeroed out from the get-go). So, the moral of today’s short story: If you are seeing a white border around your page layout, try explicitly setting your padding and margins to 0 for your HTML body.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s