Floats are a powerful feature of CSS and for the most part are pretty straightforward to use.
However, there are many subtleties about them which can cause people to wonder why, for example, images aren’t correctly positioned.
Usually the quickest solution is to throw a bunch of clear: both CSS rules either onto objects or onto empty divs.
This post goes into some of the details about how floats are implemented and how to use them.
How the various browsers’ float implementations differ will also be discussed, but for the most part the latest versions of the browsers all do a good job of agreeing with how to implement the specifications.
-
-
Animation in web applications can do more than add pizazz to a page, it can give good visual cues to the user as to what is happening.
For example, consider an image carousel, where you have one largish image and smaller ones in the background.
Having images animate to get larger and move into place (in addition to sliding on and off the screen) lets the user confirm the intended image is being shown. -
There are several methods you can use to create odd/even stripes for lists to make them easier to scan. A List Apart had an article about creating stripes, but being over five years old, it understandably doesn’t cover some newer techniques which are available. Then again, the need to support legacy browsers makes the article more relevant than you would think at first.
-
A co-worker mentioned one day that he was having problems with setting multiple cookies in the same
Set-CookieHTTP header, but things were fine if they were set with separate headers. He noted that it was not consistent across browsers, and that the specs seem to indicate that you can set multiple cookies with a single Set-Cookie header; RFC 2109 confirms that. -
Imagine my surprise when I finally got around to testing comments on this live site and found they weren’t working at all. Then imagine my confusion of them working on my test site just fine, with all the same settings.
My apologies for anyone who has tried to submit a comment. For what it’s worth, you should be able to do so now.
Seems with the settings I had (only allowing comments from logged-in users) you can type in a comment but after submission you get a blank page.
Sigh.
I’ve changed the settings to not require a login for comment submissions. Hopefully I’ll be able to take a closer look at some point to see why things weren’t working.
-
CSS3 has a module which describes Multi-column layout which at first glance seems similar to table layouts. The main difference is contents in a block with multi-column layout will flow into the multiple columns, while content in tables will stay within the original columns.
-
In a previous post about using CSS to style HTML tables, I covered collapsing borders, empty cells, and the
inline-tabledisplay type. In this post I’ll cover headers and footers, captions, and columns, as well as other points which are good to know when using CSS with tables. -
Modern browsers have the ability to display very complex HTML tables when using CSS to style them. While there are people who frown upon using tables for page layout, there’s no better nor no more flexible way to display tabular data than using tables. While this post is not a tutorial on HTML tables, it will describe some of the intricacies of styling them. The techniques shown here target recent versions of Safari, Firefox, Opera, and IE.
The information in this post was derived the specifications for CSS 2.1 and various versions of HTML (HTML 4, XHTML 2, and HTML 5 are similar enough for this discussion).
-
The current version of Mobile Safari on the iPhone and iPod touch allow you to do 3D transformations in CSS. This allows you to give objects perspective and rotation in 3D space, as well as the ability to use transitions and animations.
-
This follow-up to my post about SSL and IP addresses covers using SSL with multiple ports on the same IP address. We often use alternate port numbers to provide test versions of a host or application, since just changing the port number keeps the
ServerNamethe same.





