Posts by William

Cross-Browser Compatibility

Posted by on Nov 10, 2010 | Comments Off

One thing that causes a lot of headaches for web developers is getting sites to look good in every browser. Notice that I did not say, getting a site to look the same in every browser. While it’s possible to get a site to look more or less the same, there are always going to be minor differences and it’s generally more trouble than it’s worth. As long as the site looks good and has consistent branding, there’s no reason that it needs to look identical on every computer. Once you realize that, web design becomes much less of a hassle. One method is to build out a basic...

Read More

Pagerank, Relevance, and the SERPs

Posted by on Nov 3, 2010 | Comments Off

We’ve previously talked about why pagerank doesn’t matter, but a number of people still attach a great deal of importance to it. It’s easy to see their point: plug pretty much any search term with any competition into Google, and the top results are likely to be mostly high-PR sites. What many people don’t realize is that the high PR is a symptom of what’s making the page rank well, not a cause. What does that mean? Well, suppose I have a website talking about topic X. This is a really good site, so I get a lot of links to it, many of which will have anchor text...

Read More

Page Flow, Inline and Block Elements, and Relative Positioning

Posted by on Oct 25, 2010 | Comments Off

The HTML flow model is pretty simple: every element goes in a box, and the web browser stacks up those boxes when you view the page. Block boxes, which are generated by tags such as <p> and <h1>, get stacked on top of each other, while inline elements stay (surprise, surprise) in a line (unless the line reaches the edge of the container, in which case it runs over to the next line). Easy enough, right? Although elements have a default type (block or inline), you can change this in your CSS with the display: property. You can also set display: none, which keeps the element from...

Read More

Understanding Relative Positioning in CSS

Posted by on Oct 22, 2010 | Comments Off

One aspect of CSS that can be a bit confusing (not that there aren’t plenty of those) is relative vs absolute positioning. It really seems a bit backwards at first. Suppose you have the following code: #container { position: relative; } You might think this means that you’re not positioning container relative to something else, but in fact it means that other boxes inside container can be positioned relative to it. If you give absolute positioning to elements inside container, they’ll now have an absolute position relative to the container. Confusing enough? Consider this...

Read More

CSS Programming and IE6, Part 2: The Box Model

Posted by on Oct 21, 2010 | Comments Off

Let’s start with a quick review of the CSS box model. Suppose I have a div. From the outside in, I first have the margin, which is distance from the surrounding elements. Then there’s a border. Inside the border is padding, and inside that is the content. In a modern browser, the total width that the div takes up on the screen (from the border in) will be the combined widths of the content, padding, and border. For example, given a div with width of 80px, border 3px, padding 7px will take up 100 pixels (80 + 3 + 3 + 7 + 7), as specified by the CSS standard. In IE6, it will take up...

Read More