Archive for the 'Tutorials' Category

How Expression Web 2 Creates CSS

Expression Web, Tutorials No Comments »

Anna Ullrich just published an excellent article called Who’s Editing Your CSS? explaining how Expression Web 2 handles CSS and why you can trust the program to spit out proper non-bloated code.

If you’ve watched my webcast or read any of my articles you should have an idea of this but Anna’s article is far more thorough than anything else I’ve read.

Oh, by the way Anna: Who is editing your CSS? Your page is broken in Opera ;o)

Expression Web 2 Webcast June 5th - What do you want to know?

Expression Web, News, Tutorials 2 Comments »

Building Compelling Websites on the Microsoft Platform

I’m doing an Innovation Briefing Webcast about Expression Web 2 for Microsoft this coming Thursday at 11am Pacific Time. Hit the link below to sign up to join in. I don’t know if there’s still more spots for registration but if not, the entire one hour session will be recorded and published in wmv format for download and streaming.

I’m meeting with the Expression Web dev team on the Tuesday before and I haven’t really nailed down what to present at the webcast so if you have any questions or want to see a demo of a specific function or anything like that, please drop me a line and I’ll work it in.

Before you ask: No, I don’t work for Microsoft.

WEBCAST DATE
Thursday June 5, 2008
2:00 PM - 3:00 PM ET
Event ID: 1032350422
Register Now

Fancy Interactive Pure CSS List Boxes with Hover Effect

CSS, Expression Web, Tutorials 2 Comments »

Box List with hover effect

There was an urgent need to expand the product gallery for the Nature’s Carpet website I built last fall. More specifically they were asking for the ability to easily update and ad new carpets with info and pictures. The info would be fairly minimal (name, product number, some short details) and the most important aspect would be the ability for the visitors to see high quality photos of the carpets as surfed through without having to open new windows etc. In accordance with my new found obsession with standards based code and CSS, I decided that this could be an interesting challenge: Could I make a tableless product gallery with pop-up images triggered by roll-over behaviours and some other fancy effects while still keeping all the info in an unordered list? Well, after some trial and error, the answer is yes. And here’s how it’s done (I actually did all the styling in Expression Web using the Modify Styles functions, but for brevity (and those of you who don’t use Expression Web) I am just going to list out the actual CSS code here):

From idea to reality

One of the challenges with the Nature’s Carpet site is that it will be constantly updated by the company itself. Would be easy if the backend was a CMS, but as of now it’s not so it is done manually. The tricky part was to make the code as fool proof as possible without making the site bland and uninteresting. I had this idea of having each carpet represented by a small rectangle with a thumb nail on top and the name and info underneath. When the visitor hovered over the rectangle, the background colour should change, and when she hovered over the image, a larger one should pop up automatically without having to do anything.

Step 1: Make a list

The most fool proof thing I could think of was a simple unordered list. And that’s easy enough:

<ul>
<li>
<img alt=”Aureg - Bracken” height=”100″ src=”products/dark/thumbs/Aureg%20-%20Bracken%20-9445-38.jpg” width=”150″ />
<h3>Aureg - Bracken</h3>
<p>Berber loop PIle</p>
</li>
</ul>

Problem is an unordered list looks like an unordered list. What I wanted was something that looked like a 3 column table.

Step 2: Wrap the list items in a box

To keep the list styles separate from the rest of the list items in the page, everything needs to be wrapped in a box.I call it showcaseWrapper:

#showcaseWrapper {
}

All the content in each unordered list item should also be wrapped in it’s own box. Since there are several lists, it has to be a class rather than an id:

ul.showcaseList {
padding: 0px;
margin: 0px;
list-style-type : none;
}

This strips away the regular spacing and elements featured in an unordered list. Now the list items themselves:

ul.showcaseList li {

margin: 0 4px 8px 4px;

border: 1px solid #D1CAC2;

width: 165px;

height: 200px;

background: #FFFFFF;

float : left;

display : inline;

}

Pretty straight forward: The margins are used to space the boxes evenly. Each box has a solid grey stroke and a white background. They float to the left and line up side by side rather than on top of each other. Take special note of the “width” and “height” numbers: They are not flexible because I want the items to line up nicely. These values match the content displayed perfectly and fills out the space nicely. Depending on what you want to put inside your boxes, you can change them. I would advice against making the height dynamic because if one box is taller than the rest, the order becomes disorder and the whole thing becomes a big mess.

Step 3: Make a Hover Effect

I also wanted the boxes to react to the mouse hovering over them to give the visitor a more interactive experience. This is surprisingly easy: Just ad a “hover” stage to the list item with some different info like this:

ul.showcaseList li:hover {
margin: 0 4px 8px 4px;
border: 1px solid #D1CAC2;
width: 165px;
height: 200px;
background: #E7E2DE;
float : left;
display : inline;
}

Notice that the only difference is the background colour. You could make it more fancy by using a graphic background and the sliding doors technique like Verlee did. Or you could make the entire list item into a link. The posibilities are endless.

Step 4: Style the Content

Now it’s up to you to style the content as necessary. Since everything is wrapped in the showcaseWrapper id, you can safely style everything within the wrapper without it affecting the rest of your site. Here are a couple of examples:

#showcaseWrapper ul.showcaseList img {
padding: 6px 7px 3px 7px;
}

#showcaseWrapper ul.showcaseList h3 {
margin: 0px 10px 0px 10px;
color: #666666;
display : block;
text-decoration : none;
font-family: Arial, Helvetica, sans-serif;
font-size: 1em;
font-weight: bolder;
font-style: oblique;
text-transform: uppercase;
height: 2.6em;
}

Final HTML Markup

<div id=”showcaseWrapper”>
<ul class=”showcaseList”>
<li>
<img alt=”Aureg - Bracken” height=”100″ src=”products/dark/thumbs/Aureg%20-%20Bracken%20-9445-38.jpg” width=”150″ />
<h3>Aureg - Bracken</h3>
<p>Berber loop PIle </p>
</li>
</ul>
</div>

Final CSS

/* The box that wraps the entire list /*

#showcaseWrapper {
}

/* Styles for text not contained in the lists  */

#showcaseWrapper h2 {
color: #666666;
font-size: 1.2em;
text-transform: uppercase;
margin-left: 5px;
margin-top: 0px;
clear: both;
}

#showcaseWrapper p {
padding : 10px;
clear : both;
}

#showcaseWrapper a {
color: #5F8C00;
}

#showcaseWrapper a:hover, #showcaseWrapper a:focus, #showcaseWrapper a:active {
color: #3D5900;
text-decoration : none;
}

/* The list itself  */

ul.showcaseList {
padding: 0px;
margin: 0px;
list-style-type : none;
}

/* Turning each list item into a box and stacking them sideways */

ul.showcaseList li {
margin: 0 10px 8px 4px;
border: 1px solid #D1CAC2;
width: 165px;
height: 200px;
background: #FFFFFF;
float : left;
display : inline;
}

/* The hover effect for the list box  */

ul.showcaseList li:hover {
margin: 0 4px 8px 4px;
border: 1px solid #D1CAC2;
width: 165px;
height: 200px;
background: #E7E2DE;
float : left;
display : inline;
}

/* Styles inside the list boxes */

#showcaseWrapper ul.showcaseList h3 {
margin: 0px 10px 0px 10px;
color: #666666;
display : block;
text-decoration : none;
font-family: Arial, Helvetica, sans-serif;
font-size: 1em;
font-weight: bolder;
font-style: oblique;
text-transform: uppercase;
height: 2.6em;
}

#showcaseWrapper ul.showcaseList p {
font-size : 0.9em;
padding : 0;
margin: 5px 10px 10px 10px;
}

/* Padding the image */

#showcaseWrapper ul.showcaseList img {
padding: 6px 7px 3px 7px;
}

Here again is the final result. And yes, it validates (provided the client didn’t mess with the html code).

Center a Page Horizontally Using CSS - An Expansion

CSS, Expression Web, Tutorials 3 Comments »

This is an expansion to Anna Ullrich’s tutorial Center a page (horizontally) by using CSS which can be found on her blog. I’m picking up where she left off, so if you are confused about where we are when we start, I suggest you read her post first.

In this tutorial I’m going to isolate the CSS styling in Anna’s tutorial and move it to a separate style sheet (.css file). Doing this has two benefits: First off you can apply the same style sheet to multiple pages without having to insert all the code in each one. Seccondly, by leaving all the styling in a separate file, you can make global changes to a whole web site by just changing one file. This is a major benefit if you are working with larger sites that have many pages.

Starting point

At the end of Anna’s tutorial we were left with this block of code:

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml”>

<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″ />
<title>Untitled 1</title>

<style type=”text/css”>

.style1 {
background-color: #CC0066;
}

</style>
</head>

<body style=”background-color: #CCCCFF”>

<div style=”width: 395px; margin-left: auto; margin-right: auto;”>
<p class=”style1″>
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Curabitur id lectus.
Vivamus vitae neque. Morbi at sapien. Etiam pharetra velit non dolor tempor
bibendum. Nullam nibh. Aenean quis elit. Cras posuere, sem eu tincidunt dictum,
nisl arcu laoreet ipsum, ac aliquet orci augue sed nulla. Nunc libero sapien,
egestas id, aliquam eget, semper id, nunc. Quisque tempor consequat quam. Nullam
sapien libero, viverra non, varius vitae, pharetra nec, nisi. Cras egestas
consectetuer justo. Nullam ante orci, luctus ut, ullamcorper nec, eleifend eu,
justo. Donec eleifend nibh eu nunc. Nunc porta consequat mauris. Cras libero
diam, ullamcorper id, adipiscing non, tincidunt ac, eros. Ut auctor tortor vel
purus. Nullam dapibus. Mauris pede urna, vestibulum eget, pellentesque a,
consectetuer at, eros.
</p>
</div>

</body>
</html>

This code creates a page that looks like this:

Image borrowed from Anna Ulrich's blog

Let’s quickly dissect the code to help understand exactly what’s going on. The first important part of code is contained in the <head> area:

<style type=”text/css”>

.style1 {
background-color: #CC0066;
}

</style>

Everything within the <style type=”text/css”></style> containers will be interpreted by the browser as styles to be applied to the content further down in the document. What this particular piece of code says is that every time the style of the class “style1″ is applied to content, that content should have a background colour of hot pink (#CC0066). You can see the class being called further down in the document:

<p class=”style1″>
Lorem ipsum dolor sit …
</p>

In addition to the very attractive pink background (sorry Anna, but in spite of my company name, pink really isn’t my colour) there is more styling applied to the text, but this is contained in a div within the html code itself:

<div style=”width: 395px; margin-left: auto; margin-right: auto;”>

This line of code says that all content between the two <div></div> containers should be 395px wide and have a left and a right margin set to “auto”. It’s this line of code that centers the content: By telling the browser that both the left and right margins are automatic, the browser will give them equal values depending on how big the window is and put whatever is in between in the center.

But this is a somewhat messy way of doing it, because most of the styling is inside the html code and is not repeatable. What we want to do is make it a style that can be used again and again. You can avoid this problem by employing a different method when you build the site - I’ll post a different tutorial for this technique - but for now, we’ll just fix the code to make it more funcional:

Sifting out the styles

Since we already have the style settings, all we need to do is move them to the style area in the <head> by cutting and pasting the definitions like this:

<style type=”text/css”>

.style1 {
background-color: #CC0066;
width: 395px; margin-left: auto; margin-right: auto;
}

</style>

To make this more understandable, we can rewrite it like this:

<style type=”text/css”>

.style1 {
background-color: #CC0066;
width: 395px;
margin-left: auto;
margin-right: auto;
}

</style>

To make this work properly, you also have to make a small change in the html section replacing this:

<div style=”width: 395px; margin-left: auto; margin-right: auto;”>
<p class=”style1″>

with this:

<div class=”style1″>
<p>

Much simpler, right? Well, we can do even better. Notice how the <body> is also defined within the html code? We should move that to the styles section as well:

<style type=”text/css”>

body {
background-color: #CCCCFF;
}

.style1 {
background-color: #CC0066;
width: 395px;
margin-left: auto;
margin-right: auto;
}

</style>

Finally we remove the styling from the <body> in the html section. Now the html is “clean” and the styles are all contained in a separate area.

Modifying the styles

This is where Expression Web’s excellent CSS tools kick in for real. Now that we have separated all the styles, Expression Web lets us play around with them in any way we want without typing a single line of code.

Manage Styles panelYou’ll notice that the Manage Styles panel now has two entries: body and .style1. By right-clicking on either one of them and clicking “Modify Style”, you open the Modify Styles panel where you can edit the styles in pretty much any way you wish. If we open the panel for .style1, we see all the information contained in the style: The name of the style, what categories are active (in bold), a preview of the style as a whole and even a complete text sting of the entire style. From this panel you can make all possible changes to the style and see the results in real-time both in the preview window, the code window and also in the visual area of the design page. Likewise you can use the “New Style” button in the Manage Styles panel to create new styles through the same window. And once you have styles in your Manage Styles panel, you can apply them to any portion of the content simply by highlighting the area, right-clicking on the style you want and selecting “Apply Style”.Style1 modifier

Making a separate style sheet or CSS file

Finally, we are going to port the styles to their own file, also called a Style Sheet or a .css file. Microsoft Expression makes this very easy. First off, you need to make a new .css file: File -> New -> CSS. This opens a fresh CSS document. Save it wherever you want and give it a reasonable name. I tend to name the main .html file and it’s corresponding .css file the same, so since my main file is called centeredContent.html, I save my .css file as centeredContent.css in the same folder.

Next, click “Attach Style Sheet” in the Manage Styles panel and select the file you just created. This causes two things to happen: First, a line of code is added to the <head> of the html page:

<link href=”centeredContent.css” rel=”stylesheet” type=”text/css” />

This is a relative link telling the browser that there is a file that relates to the page called “centeredContent.css”, that this file is a stylesheet and that it’s content is css code.

NOTE: At this point I renamed the style “.style1″ to “.box” to reflect exactly what it does. You can do this in the Manage Styles panel, in the code or in the pop-up window. Just remember to change the name in the html code as well so that where it used to say <div class=”style1″>, it should now say <div class=”box”>.

Secondly, the Manage Styles panel now shows the attached style sheet file:

managestyles2.jpg

But as you can see, centeredContent.css has no styles in it yet. So next we grab the styles and simply pull them down on top of the name of the .css file and voila, the styles are in the external style sheet. If you look at your <head> you’ll see that the styles are gone from the <styles> area, so you can delete the whole <styles> section without anything happening. When you open the centeredContent.css file, you’ll see that the styles are now resting there. You might think that this will cause problems, but because of the way Expression Web handles CSS code, nothing really changes. You can still manage the CSS code from the Manage Styles panel the same way you did before, from the html file, without ever opening the .css file, and you still have the same control as before. The main difference is that you can now create multiple html files that get their styles from the same .css file and that changing styles in that one file will impact all the other html files.

The end result looks the same (but appearances can be deceiving)

That’s it. The page looks exactly the same as before, but the code is much cleaner and we now have the ability to build many pages using the same style sheet.

Final code for centeredContent.html:

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml”>

<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″ />
<title>Untitled 1</title>

<link href=”centeredContent.css” rel=”stylesheet” type=”text/css” />
</head>

<body>

<div class=”box”>
<p>
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Curabitur id lectus.
Vivamus vitae neque. Morbi at sapien. Etiam pharetra velit non dolor tempor
bibendum. Nullam nibh. Aenean quis elit. Cras posuere, sem eu tincidunt dictum,
nisl arcu laoreet ipsum, ac aliquet orci augue sed nulla. Nunc libero sapien,
egestas id, aliquam eget, semper id, nunc. Quisque tempor consequat quam. Nullam
sapien libero, viverra non, varius vitae, pharetra nec, nisi. Cras egestas
consectetuer justo. Nullam ante orci, luctus ut, ullamcorper nec, eleifend eu,
justo. Donec eleifend nibh eu nunc. Nunc porta consequat mauris. Cras libero
diam, ullamcorper id, adipiscing non, tincidunt ac, eros. Ut auctor tortor vel
purus. Nullam dapibus. Mauris pede urna, vestibulum eget, pellentesque a,
consectetuer at, eros.
</p>

</div>

</body>
</html>

Final code for centeredContent.css:

body {
background-color: #CCCCFF
}
.box {
background-color: #CC0066;
width: 395px;
margin-left: auto;
margin-right: auto;
}

Designing a WordPress Blog Theme Using Expression Web

CSS, Expression Web, Tutorials 6 Comments »

I’ve been working with Expression Web for about 6 months now and I’ve found that above all other things, what sets this program apart from the competition is it’s handling of CSS. More specifically how easy it is to not only write CSS from scratch but also to modify existing code for fantastic results. Case in point: The new look of this blog. If you’ve visited before you’ll notice that I recently upgraded it from the dull look of a standard WordPress blog to something altogether different. And what will (hopefully) surprise you is that once the design was conceived (which took some time) the actual coding only took a couple of hours! All this thanks to Expression Web and how it handles CSS code.

modify-style-box.jpg

People often ask me how to make their WordPress blog look great. In the past I’ve always told them that it’s a lengthy process and you really need to know a lot of code to get to where you want to be. That’s just not the case any more. I am willing to go as far as saying that with some basic training and a rudimentary understanding of html, anyone can make significant and functional changes to their blog using Expression Web without ever knowing what CSS is and how it works (this technique will work on any blog or other website that uses CSS btw.)Rather than just blabbering on and on about how great this program is for designing and re-designing blogs (and no, I’m not on the Microsoft payroll even though I’d like to be - hint hint people!) I’m going to show you just how easy it is to make changes to your blog by tweaking the CSS code with Expression Web.

DISCLAIMER: Although altering CSS code in Expression Web is very easy, it doesn’t mean that the end result will be very attractive. For that you need an eye for design. So even though you follow my instructions to the letter, there is no guarantee that your blog will look any better. I’m just giving you the tools: It’s your job to bring the creativity. Not everyone is a designer. Harsh, but true.

Step 1: Set up a blog with editable CSS

There are two main ways to set up a blog: You can get one for free at WordPress.com, Blogger.com or any number of other places. Just make sure you are free to edit the CSS through the service. I know Blogger.com allows you to do this, I’m not sure about the others. Or you can host one yourself. As far as I know, the most popular blogging software out there is WordPress, but there are others that work just as well. The good thing about WordPress is that it’s 100% free, constantly improved and that there are thousands of great plug-ins and other goodies to make it more interesting. The advantage of hosting a blog yourself is that you have complete control over the content and that you have your own domain name rather than something like myblog.wordpress.org.

Step 2: Design your blog visually

This is by far the most important and time consuming step. The only way to make your blog stand out visually is to make it look good. And the only way to make it look good is by having a great design concept. I can’t tell you how to do this; it’s like painting a picture or writing a poem - creative work defies explanation. What I usually do is I write down some words that describe what I want to convey in terms of emotion, “feel” and so on. Once I have a general idea I play around with colour combinations in Kuler and find something that fits. Then I look for inspiration and start sketching things out on paper. Finally I consolidate all my ideas into an actual image of what the final product should look like in a program like Expression Design. For this blog I used Adobe Illustrator, Adobe Photoshop and Expression Design to create the final graphical representation of the blog. If you want anything more than just simple boxes and colours, this step is vital.

Step 3: Find a theme that fits your vision

Blogs work on two planes: PHP on one side and CSS on the other. The PHP portion for the most part decides what content is displayed and the CSS side decides how this content is displayed. But the PHP portion also has an impact on how the content is displayed because it decides where different elements appear like if the sidebar should be on the left or the right, whether the menu is vertical or horizontal etc. If you intend to build your new blog from scratch and you don’t know PHP well, this can be a grueling process. Fortunately much of the work has already been done for you by others. (I have to tread lightly here because what I’m about to say might sound like blatant plagiarism.)

Rather than building your theme from scratch, try to find one that has the basic components you are looking for already laid out. In most cases one of the standard themes have everything you need and if not you are almost certain to find one that does. So rather than reinventing the wheel, you should build on the experience of others and focus on making things better. Just be warned: This is touchy territory. If you blatantly rip off someone else’s theme without giving them credit, you are in for a world of hurt. The line between borrowing and stealing code is very thin and you can easily step over without even knowing it. So to be safe it’s always a good idea to credit the creator of whatever basic theme you decide to build on.

Step 4: Understand the inner workings of your theme

div-boxes.jpgEvery theme is different. And if you want to reshape a theme to your vision you need to understand how it works first. In the past this process was a total nightmare, but with Expression Web it is incredibly simple:

  1. First off, if you haven’t already done so, set your blog up as a Site in Expression Web so you have access to all the files.
  2. Open your blog in your favourite web browser and display the source code. In FireFox you click Ctrl+U and a new code window opens.
  3. Copy the entire code and paste it in the code view of a new html file in Expression Web. Save the file in the root of your site as something. I like the name testBed.html but you can call it whatever you want.
  4. Find the CSS call in the html code and redirect it to the local file you will be altering. I usually set up a new theme folder with all the old theme files in them so that I can always revert back to the original CSS file if I mess things up really bad. It’s good insurance.

div-list.jpgNow you have complete access to your theme and it’s CSS and you are ready to understand exactly how it works. While in Design view you can now click on any element and see the complete list of divs and other elements that make this specific part of the blog look the way it does. You will also see all divs and other elements displayed as superimposed boxes showing how the content flows. That way you will immediately get a solid understanding not only of how the theme works but what you need to change to make it look the way you want.

Step 5: Start choppin’!

If you’ve decided to make a graphic-heavy blog, you need to “chop” your design into manageable pieces. To be more precise, you need to cut out all the elements you want to feature in your blog in such a way that they’ll fit inside the divs, tables or whatever other element you wish to display them on. Expression Design and it’s Crop Marks feature is excellent for this purpose. You can see how this is done in this video demo I posted last year. How exactly you chop your design is up to you - it all depends on the desired end result. I’ll post some examples in a separate article later.

Step 6: Re-styling the Style Sheet

drag-div.jpgThis is the fun part: Once you have your testbed set up and connected to a local CSS file, you can start messing around. There are several ways of doing this depending on what you want to achieve. If for instance you want to alter the width of your main content area, all you have to do is click on any object within that area, then find the div that controls the area you want to change in your top bar and finally resize it by moving the sides using your mouse. It couldn’t be easier.

manage-styles.jpgIf you don’t like the brute force approach you can fine tune the code using the Modify Style feature: First off, click on the element you want to change. The style that controls this element will automatically be highlighted in the Manage Styles tab. Right click on the style, select “Modify Style” and a window will pop up with all the different options for modifying the style. Now you have complete access to the style and you can change it in any way you want for immediate results.

Step 7: Watch your changes in real time

A great thing about this method is that as you change the CSS code, you can see the changes in real-time right inside Expression Web using the Design view. Any change made will immediately be visible and as a result you see right away if something isn’t exactly working out the way you planned. It also means that if you do things that are not allowed in CSS, you’ll see that it doesn’t work and you can find out what went wrong. If you want to you can also make changes directly in the style sheet and see the changes in real-time. As a result, your style coding process becomes much easier and more effective.

Step 8: Save your changes

When you work with style sheets in Expression Web, you are actually working in two documents simultaneously: When you make that initial change in the stylesheet link (step 4) you are actually opening the .css file for editing. And when you save your testbed, the program will ask you if you want to save the changes to the embedded file as well (that would be the style sheet).

save-embedded.jpg

That way you avoid forgetting to save your latest CSS alterations and the process is that much simpler.

Step 8: Upload, test and publish

Now all you have to do is upload the new CSS file and any related graphics, make whatever changes you want to the php code and your blog will have a new look.

Observations, tips and pitfalls

There are a couple of things you need to know about styling blogs. First off, all blogging software is different so the php code will vary greatly. If you are planning on making massive structural changes in the blog, you might want to take a very close look at the documentation. Secondly, blogs often work with separate pages. In WordPress you have three sets of views: the “index” view, the “Pages” view and the “single post” view. To fully restyle your blog you need to make changes to all these views. The easiest way to do this is to open each view in your browser, copy the source code into your testbed document and make changes on a view-by-view basis. That way you have all bases covered. Third, make backups! It’s easy to mess things up really bad if you are just experimenting, so when you have something you like, make a backup. That way you can always go back and fix whatever you broke. Fourth, Ctrl+Z only works in the document you are currently in. So if you make a CSS change in your testbed document and then hit Ctrl+Z or click “Undo”, the undo will only affect the testbed document and not the CSS document. To undo your latest blunder in the CSS document you have to have that one open. It’s easy to forget and can lead to some real hassles later on. Fifth, WordPress templates are full of errors to begin with. These normally consist of unclosed or excessive divs and will normally show up in Expression Web as yellow highlights. Take the time to fix these in the PHP code or you could get some really bizarre results in browsers you didn’t test. Finally, test in as many browsers as possible. CSS is notoriously complicated because all browsers handle it differently. But if you do things properly your blog will look the same in all environments. Unfortunately the only way of making sure is to test it in all browsers, even ones you don’t really use.

So there you have it. That is the rough outline of how I restyled this blog to make it look the way it does now. The same technique was used to restyle the Vancouver blog Dabbler.ca and several other blogs I’m currently working on. It’s fast, effective and functional. I am guessing that the Expression Web team is going to touch on the same techniques in their presentation at MIX08 later this week (but I could be wrong - there are probably better ways of doing this) and I am definitely going to be there to pick up some more tips and tricks.

I’ll be posting some code examples to give you an idea of exactly how this blog works later on. For now, design, experiment and have fun.