Monday, October 13, 2008

xkcd says: Steal This Comic


The title text for this strip from xkcd.com reads:

I spent more time trying to get an audible.com audio book playing than it took to listen to the book. I have lost every other piece of DRM-locked music I have paid for.


While not directly relevant to our goals of web design and programming tips, if you're designing anything and considering DRM, I suggest you revise your strategy.

Thursday, September 4, 2008

Google Chrome Hacks

Hack is far too strong a term for anything I've got for you to play around with yet. There are some interesting "hacks" posted online involving "hidden" pages in the Chrome browser of the "about:XYZ" variety. A quick search should be able to pull them up. (I'll post a link later, but I'm otherwise occupied at the moment.)

I noticed that the "inspect this element" option pulled open a new window with a URL beginning "chrome-resource://".

Playing around a bit, I discovered a basic "About Google Chrome" page at chrome-resource://about/ (click to try it out if you're using Chrome right now).

That's all for now, but maybe I'll actually update this a bit more now, with stuff related to Chrome, browsers, and (yes, of course) web design as well!

UPDATE: Using the "view-source:" prefix, check out the "chrome-resource://about/" page seems interesting.

Tuesday, April 3, 2007

DTDs && head elements && general encoding style

Summary
Each time I begin to code a page, I have to consider a few basics. These are things anyone who codes pages should be aware of already, but for those new or who would like a concise outline, here are some thoughts on: Document Type Definitions (DTDs), especially Doctype declarations; head elements, including metadata and relative links; and stylistic choices related to good practices.

NOTE: Throughout, we will use » to indicate a line-wrap.

DTDs
Using X(HT)ML requires an XML declaration including version information at the start of the page. For this purpose, I generally use: However, you can choose to use any particular version of XML your heart desires. Following this is the Doctype declaration, which must be the first item in the file if not using XML (and hence requiring the XML declaration to be the first item of the page). For the Doctype declaration, we want to let the browser know what format our page is using. Hence, when using HTML 4.01 Transitional, you should use:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 » Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

And when using XHTML 1.0 Strict, you use:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 » Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1- » strict.dtd">

I myself use the latter on my websites, but here is a convenient list of other Doctype declarations:

HTML 4.01 Frameset
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 » Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
HTML 4.01 Transitional
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 » Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
HTML 4.01 Strict
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML » 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

XHTML 1.0 Frameset
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 » Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1- » frameset.dtd"">
XHTML 1.0 Transitional
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 » Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/ » xhtml1-transitional.dtd"">
XHTML 1.0 Strict
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 » Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1- » strict.dtd">

XHTML 1.1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML » 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

Further examples can be found on the W3C website at http://www.w3.org/QA/2002/04/valid-dtd-list.html.

NOTE: Do not forget to include the xmlns attribute in your html tag if you're using xhtml:

<html xmlns="http://www.w3.org/1999/xhtml" » xml:lang="en" lang="en">

Head Elements
The W3C page referred to above mentions the following meta tag which I personally use and would like to endorse:

<meta http-equiv="content-type" » content="text/html;charset=utf-8" />

This is also obviously the place to declare a linked stylesheet, unless using the @import feature of CSS, with the following declaration:

<link rel="stylesheet" href="cv01.css" type="text/css" />

The W3C also recommend using <meta http-equiv="Content-Style-Type" content="text/css" /> to let the browser know how your page is styled. Obviously this may be different for you if you're using XSL(T) with your X(HT)ML.

I also think this is a good place ot include any <script> tags used throughout the page, as they share a similar relationship to the page as your stylesheets do.

General Style for Encoding
Good practice dictates that we use comments and whitespace in our code to make it more legible (read: human readable). I, for the most part, am not in the habit of commenting my web page code as it tends to be fairly intuitively laid out. This is aided, though, by my careful use of whitespace: while using a tab for each layer of code may result in a blocky-looking text file, using a space for each level aids legibility and is still generally sufficient for most distinctions. For example, a basic page template:

<? xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 » Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1- » strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" » xml:lang="en" lang="en">
 <head>
  <meta http-equiv="content-type" » content="text/html;charset=utf-8" />
  <link rel="stylesheet" href="cv01.css" » type="text/css" />
  <title>
   The Page's Title
  </title>
 </head>
 <body>
  <p>
   The Page's Content
  </p>
 </bodyl>
 </html>

If your page is particularly complex, adding a few blank lines, for instance between </head> and <body> can add clarity. Comments are always a good idea, especially on collaborative projects or pages that you aren't likely to work on for a long time.

Conclusion
While this has by no means been a comprehensive outline of good practices for encoding modern web pages, I hope that it aids you at least as a summary or reference regarding DTDs, head elements, or stylistic choices. Make your code legible, and make sure that browsers know how to handle it.

Wednesday, March 21, 2007

opening && window considerations

Weblog Introduction
First of all, a brief introduction: this blog is meant to be a personal exploration of elements of web design. That being said, the primary sort of post should be factually relevant for virtually any designer/coder. For example, today's post...

Page Dimension Recommendations
Depending on the aim of your site, you may choose to target the traditional 800x600 resolution 1024x768 resolution, or some less commonly cited dimension (1280x800, for example). Many users are still running 800x600 screens, though, and 1024x768 is likely to become the new standard in coming years. (Based solely on the web usage statistics available from the W3C.)

Furthermore, most users till use IE, though a secondary group uses Firefox, and nearly all Mac users use Safari (at least as far as I know). As such, I did a little exploration regarding displayed page dimensions in IE and Firefox on 800x600 and 1024x768 screen resolutions.

The following data are based on limited investigation on my part and intended solely as a starting point in determining page layouts.

Firefox 800x600 - 783x437
IE 800x600 - 779x461
Firefox 1024x768 - 1007x605
IE 1024x768 - 1003x612

Conclusions
It appears that keeping your most important content within a 700x400 box is sufficient for 800x600 layouts and a 1000x600 box is sufficient for 1024x768 layouts.

Caveat: These data are preliminary and have not yet been checked in any capacity--a more extensive report on dimensions for page layout should come within the next couple of months, depending on my schedule.

Postscript: I realise that this post is itself poorly formatted, but I haven't the time to do more just now--'tis already 00 30, and I need to get some sleep tonight.