Auto margin shifts my page content to the left

I found myself wasting about 2 hours of my time trying to understand why only one of my pages moved about 16px to the left when switching back and forth between the different page. My problem is that I was using a template and that everything on the two pages were exactly the same. Here is an example of what I mean.

Using the famous divide-and-conquer problem solving method (ha ha!), I started to remove some text to find out the culprit paragraph, and realized that the problem was only present when I had a lot of content on the page. After a few google searches, I found a thread on sitepoint’s site that explains exactly my problem (titled: Web Page Wiggle Issue and Margin Auto Wiggles & The Vertical Scrollbar). The problem lies in the use of “auto” for centering pages, much like in the very popular “body {margin: 0 auto; width: 960px;}”. This causes the page to wiggle (move to the left) between pages where the vertical scrollbar is needed (longer content) and where it doesn’t appear (firefox adds the scrollbar as needed, whereas IE always keeps it!). From the website, I found two fixes for the problem:

You can easily fix this, using CSS, by adding this one line in your stylesheet:

html {overflow-y: scroll;}

Another fix, if you are using JQuery, is the following:

$(function(){
    $('<div/>').css({
        position: 'absolute',
        top: 0,
        width: '1px',
        height: ($(window).height() + 1).toString() + 'px'
    }).appendTo('body');
});

Shopping at Chapters

Book Cover: Geometry of Design Today, I decided to go shopping for a book or two. I dropped Bonnie at work and then headed for the nearest Chapters. It was fun to walk on St-catherines St. on a Saturday night. I hadn’t done that for a long time. Anyways, I first browsed the magazine section for a good issue of Computer Arts but wasn’t impressed with their August issue and So I switched to the Web Design book section. I saw a couple of the books I keep reading about around the web like: Eric Meyers on CSS, The Zen of CSS Design by Dave Shea and Molly E. Holzschlag, and Bulletproof Web Design by Dan Cederholm. Ironically, I didn’t really like what I saw on those books, well I did but I have a limited budget, and decided against. So I moved on to the programming section. Again. Not good enough.

I finally ended up in the Design section and I decided to get Kimberley Elam’s book on the Geometry of Design. Only then did I decide to also get Jeffrey Zeldman’s book Designing with web standards. So here I am now. Two new books and a whole lot to learn.

I’ve only started to read the book by Kimberley Elam and it is really good. I mean, I’m almost done already and I’ve owned it for only two hours. The topic is really interesting, touching how mathematics can be applied to beautiful design or, in fact, how mathematics potentially explain why we prefer some designs to others. It’s a real eye-opener and I suggest it to anybody who would like to read a little on this subject. Great buy!

Book Cover: Designing with web standardsAs for the book by Zeldman, it is basically a bible in terms of how to respect web standards when developping on the web and a little introduction to the main topics surrounding the web development of today. I haven’t really started to read this one, but the couple lines I’ve read here and there were really promising. I will let you know officially what I thought when I am done. For now, I have some reading to do.

What’s The Deal With CSS ?

Why can’t they make web broswer complient. I wonder why can’t they make web browser compliant to the same rules. Let’s discuss css’s for a moment. I mean, Cascading Style Sheets are great if you ask me. They allow you to re-use code within your html pages, which is a great tool I’ve been waiting for forever. Now the problem is that Internet Explorer or Firefox (Mozilla) web broswers won’t “read” the code the same way. For the programmer in you, it’s like programming java for PC and for Mac at the same time. You have to be careful. Some bugs might pop-up when you don’t want it to be there.

The main problem I have been having with the webpage so far is this two-column business. It looked great in Firefox but IE and Opera didn’t like it. I managed to fix the glitch in Internet Explorer but forget about Opera. I give up. Good thing IE does not understand what a CSS2 selector is. Now, that said, I hope you guys enjoy the hard work I put into this website. And don’t tell me you use Opera!!! Else go get Mozilla’s Firefox!!

© Copyright Bonuel Photography - Theme by Pexeto