in

ASP.NET Weblogs

Dave Burke - A freelance .NET Developer specializing in Online Communities

A freelance .NET Developer

Blank space economies

Maybe I'm old school (heck, I know I'm old school), but I like using the tried-and-true <Table> and <img src=”/blank.gif”.. formatting approach to websites as opposed to CSS absolute positioning.  There were exceptions when I used the CSS absolute approach, but I use HTML formatting mostly.

I rewrote an old page this morning and was curious how the approach to creating a blank space with a blank.gif file evolved.

initially using a Label control

lblBlanker.Text = "<img src=\"/images/utils/blank10x10.gif\" width=\"" +
 int.Parse(dr["width"].ToString() + 50).ToString() + "\" height=\"20\">";

then using an Image control

imgBlanker.ImageUrl = "/images/utils/blank10x10.gif";
imgBlanker.Width = pw.width + 50;
imgBlanker.Height = 20;

then a static library

Cntrls.DoBlanker(imgBlanker, pw.width + 50, 20);

Less is less, after all.

Published Apr 24 2004, 01:35 PM by daveburke
Filed under:

Comments

 

Colin Ramsay said:

That's really interesting. The evolution of code and code-writing methods is something I've noticed in my code; it's amazing to see the rapid changes one can make when they are just a learned like me.

I understand your preference for table based layouts, but it really does have an interesting parallel with your main point. Table based layouts can be compared to your use of the label control. Pure CSS can be compared to the static library method. It's an evolution, from clumsy to elegant.

As a final note, in designing pages it's not usually necessary to rely on absolute positioning. Using floating elements and such allow for very flexible layouts.

See www.csszengarden.com for more, but I can certainly understand the desire to stick with what you know best if you don't have time to invest in CSS.
April 24, 2004 3:57 PM
 

Dave Burke said:

Colin, A lot of good stuff in what you say. Yes, someone (here on weblogs.asp.net) turned me onto csszengarden not long ago. I may have a new company site to put online soon (as opposed to my usual web application work), and I figured I'd learn a thing or two more about CSS then. Good analogy between CSS and the static library method. Thanks for the comments!
April 24, 2004 4:15 PM

Leave a Comment

(required)  
(optional)
(required)  
Add