SitePoint Tech Times Logo
Issue #60 March 5th, 2003  
Archives | Advertising | Search | Send to a Friend  
 
Tips, Tricks, News and Reviews for Web Coders

      In This Issue...
 
Note: This newsletter is supported solely by advertisers like the one below. We stand 100% behind every ad that we run. If you ever have a problem with a company that advertises here please contact us and we will try to get it resolved. - Kevin Yank
  Announcing Amazon.com Web Services 2.0!

Amazon.com Web Services 2.0At Amazon.com, we want to see Web services work. We believe they are important to the future of the Internet. To help stimulate Web service innovation, we now offer software developers the opportunity to integrate Amazon.com features and content directly into other Web sites using either SOAP or XML over HTTP. Partner with the leader in e-commerce and join the Web services revolution today! Participation Is Easy and Free!

To participate in the free Amazon.com Web Services Program, you simply need to:

1. Download our free developer's kit;

2. Apply for a free developer's token;

3. Write your application.

For more details, please visit www.amazon.com/webservices today.
 
  Hi, Tech Timers!

When it comes to Web technologies, I'm all over the map these days!

At the office, I'm heavily into researching every aspect of Cascading Style Sheets (CSS) as I am writing the reference appendices for a new SitePoint book on CSS. It's scary what kind of nitty gritty details about CSS I can pull out of my hat at the moment! Witness this issue's Quick Tip!

I'm also getting a higher-than-usual dosage of PHP with the new design of sitepoint.com having gone live this week. Reacting quickly to visitor feedback and bug reports to put that final bit of polish on the new site is requiring everyone at the office to pitch in -- in one way or another. If you haven't seen the new SitePoint yet, what are you waiting for?!

In my spare time, I'm deeply immersed in exploring the Apache Struts framework for a personal project. Struts is a complicated, yet extremely powerful framework for building large Web applications with Java Servlets and JSP. It takes care of many of the code organization issues that so often plague sites built with server-side Java so that you can focus on the application. And while saves you from having to re-invent the wheel, you first have to learn how the super-powered, ready-made wheel they provide works. If nothing else, I'm sure this project will spawn a feature article or three. :-)

Dream job? I think so!

Speaking of feature articles, be sure to read my all-new article this issue! It's been awhile, and it's good to be back in the writer's seat.

Kevin Yank
techtimes@sitepoint.com


We value your membership. If for some reason at this time it is inconvenient for you, you may discontinue your subscription by simply sending a "Blank" email to the following address: leave-techtimes-html-8346742R@lists.sitepoint.com. Scroll to the very bottom of this issue for further instructions if you have problems.
 
  Editorial

CSS design does work! But it's not always practical...

One of the big design goals of the new SitePoint was to demonstrate that a sophisticated, content-rich, and usable site design could be achieved while complying with the latest Web standards. The front page of SitePoint complies with XHTML 1.0 Strict, and the rest of the content site will as well once we iron out a few straggling remnants of the old design.

Our CSS code is also standards-compliant, but for a few Internet Explorer-specific extensions that add to the functionality of the site on that browser, without hindering it on others. CSS was designed with these sorts of extensions in mind, so we feel well-justified making use of them.

Now, with all that said, I think the goal was only achievable because of the nature of the site we were building: a content-driven information site for Web developers. If we had to build the Web site for the next Lord of the Rings movie, or for a community of gamers, we'd have been much harder pressed to produce a satisfactory result with pure standards-compliant code. CSS2 is a great start, but it isn't up to the task of creating graphically rich, organic layouts.

CSS2 is very much centered on its box model, so as soon as you want to do anything non-rectangular, you have to play a manic game of "hide the boxes". This could technically be done with a bunch of empty <div> tags (one for each "decorative" element you needed to put on the page), to which you would assign background images, positions, and dimensions with CSS. But when you've got 20 <div> elements on the page that have no meaning in the document except to be "raw material" for your CSS code to play with, they might as well be table cells with spacer images in them.

The current working draft of CSS3 shows promise with support for border images, but it will be some time before we see mainstream browsers supporting such things. And even then, we'll still be talking about sticking things to rectangular boxes, which must also contain page content unless you're willing to add empty, "raw material" elements to your HTML code.

What CSS will need to provide the flexibility to create organic layouts will be the ability to position an arbitrary number of images (and possibly other primitives, including vector graphics and text) relative to any document element.

In the meantime, I say respect the standards and try not to break them without a reason. But just because we have a standards-compliant content site doesn't mean we look down on those of you whose audiences demand sites that can't be achieved with pure CSS.

Maybe in CSS4...

Kevin Yank
Editor, The SitePoint Tech Times
 
  128 bit Supercerts from Thawte

Thawte is one of the few companies that offers 128 bit supercerts. A supercert will allow you to extend the highest allowed 128 bit encryption to all your clients even if they use browsers that are limited to 40 bit encryption.

Download a guide to learn more
 
  Quick Tip

Mark external links on your site (and others!)

This issue's feature article shows you how to create links that will open in a new browser window without violating the latest W3C standards. But most people would like to know in advance if a link is going to open a new window by default.

In up-to-date browsers like Mozilla (including Netscape 6+), Opera 7, and Internet Explorer 5 for Macintosh let you use CSS to apply styles specific to element attributes. Consider the following CSS rule:

a[target=_blank]:link, a[target=_blank]:visited {
text-decoration: none;
border-bottom: 1px dashed;
}

Assuming normal links are underlined on your site, adding this rule to your site's style sheet will remove that underline from new-window links and replace it with a dashed border of the same color (borders are the same color as the element text by default).

In this issue's feature article, external links are marked with rel="external" instead of target="_blank", and we can extend our rule to apply to those links as well:

a[target=_blank]:link, a[target=_blank]:visited,
a[rel=external]:link, a[rel=external]:visited {
  text-decoration: none;
  border-bottom: 1px dashed;
}

Unfortunately, Internet Explorer for Windows does not support the attribute selectors used in these rules. If you want to support that browser as well, you can assign a CSS class (e.g. class="external") to new-window links and add a separate CSS rule for them:

a.external:link, a.external:visited {
text-decoration: none;
border-bottom: 1px dashed;
}

We use a separate rule because MSIE ignores the entire rule when it encounters a selector type it doesn't support.

As a bonus tip just for you this week, if you use Mozilla or Opera 7, you can add this CSS to your personal style sheet to help you spot external links on every site you visit! In Mozilla, you can create a file called userContent.css in the 'chrome' directory of your Mozilla user profile. For example:

C:\Documents and Settings\Kevin\Application Data\Mozilla\Profiles\kevin\b0ksf8a4.slt\chrome\userContent.css

In Opera 7, you can configure the location of your user style sheet on the 'Page Style' page of the browser settings. The default location of mine was:

C:\Documents and Settings\Kevin\Application Data\Opera\Opera7\profile\styles\user.css

After adding your rule(s) to that file, also be sure to check the 'My style sheet' option under 'Author mode', which tells Opera to use your style sheet even when displaying the page normal style sheet.

If you're new to this CSS stuff, check out my article: CSS Is Easy!
 
  New Technical Articles at SitePoint.com
Feature Article
New-Window Links in a Standards-Compliant World
By Kevin Yank

On the surface, the latest (X)HTML standards seem to frown upon links that open in a new window with target=_blank. But with a little creativity, new-window links can be done in a standards-compliant way, with minimum hassle.
Full Story

Sending Web eMail in ASP.NET
By Peter Todorov

Web email just got a whole lot easier... thanks to ASP.NET! In just 3 simple steps, Peter shows how to get your Webmail up and running.
Full Story



Build Your Site Navigation With CSS
By Larisa Thomason

CSS offers a range of benefits over images or JavaScript for use in navigation systems. Larisa explains all, and shows how to build the navigation for your site in CSS.
Full Story
 
  Help Your Friends Out

People you care about can benefit from the wealth of information on new and maturing technologies available on the Internet. Help them learn how to do it by forwarding them this issue of the SitePoint Tech Times!
 
Send suggestions and comments to: techtimes@sitepoint.com

SitePoint.com is hosted by RackSpace and VenturesOnline.

The SitePoint Tech Times newsletter is hosted courtesy of SparkList

The SitePoint Tech Times is © 1998-2003 SitePoint Pty. Ltd. All Rights Reserved. No part of this Newsletter may be reproduced in whole or in part without written permission. All guest articles are copyright their respective owners and are reproduced with permission.

You are currently subscribed to The SitePoint Tech Times as: techtimes@sitepoint.com.

Switch your subscription to the text-only edition of the Tech Times

Change the email address that your Tech Times subscription is sent to

Back to the archives

Newsletter signup

Design, coding, community or marketing? Select the right newsletters right for your needs...