Adobe
Products
Acrobat
Creative Cloud
Creative Suite
Digital Marketing Suite
Digital Publishing Suite
Elements
Photoshop
Touch Apps
Student and Teacher Editions
More products
Solutions
Creative tools for business
Digital marketing
Digital media
Education
Financial services
Government
Web Experience Management
More solutions
Learning Help Downloads Company
Buy
Home use for personal and home office
Education for students, educators, and staff
Business for small and medium businesses
Licensing programs for businesses, schools, and government
Special offers
Search
 
Info Sign in
Welcome,
My cart
My orders My Adobe
My Adobe
My orders
My information
My preferences
My products and services
Sign out
Why sign in? Sign in to manage your account and access trial downloads, product extensions, community areas, and more.
Adobe
Products Sections Buy   Search  
Solutions Company
Help Learning
Sign in Sign out My orders My Adobe
Preorder Estimated Availability Date. Your credit card will not be charged until the product is shipped. Estimated availability date is subject to change. Preorder Estimated Availability Date. Your credit card will not be charged until the product is ready to download. Estimated availability date is subject to change.
Qty:
Purchase requires verification of academic eligibility
Subtotal
Review and Checkout
Adobe Developer Connection / Dreamweaver Developer Center /

Small web team uses CSS to develop big-time magazine site

by Jason Brightman

Jason Brightman
  • Harris Publications

Created

6 November 2006

Page tools

Share on Facebook
Share on Twitter
Share on LinkedIn
Bookmark
Print
CSS design Dreamweaver 8 website

Requirements

User level

Beginning

Note: This article first appeared in the Edge newsletter.

Harris Publications is one of the largest special interest magazine publishers in the United States, with more than 70 titles. XXL magazine, billed as "hip-hop on a higher level," is one of our best-selling titles.

In fact, it is the best-selling music publication on newsstands and is widely considered the most respected voice in hip-hop. But you would never know it by looking at our old site. It was brochure-ware updated monthly with only teaser articles for the current issue.

This development article is about how the small web team at Harris Publications used CSS and Dreamweaver 8 to transform XXLmag.com from a static brochure-ware site (see Figure 1) into the dynamicpublishing platform and relevant brand extension that it is today (see Figure 2).

Screenshot of the old XXL website
Figure 1. Screenshot of the old XXL website
Screenshot of the new XXL website
Figure 2. Screenshot of the new XXL website

First things first…

Our first job was to establish a feature set for launch so that we could then develop an appropriate website architecture. Through meetings with the editorial, marketing, advertising, and publishing departments at Harris we narrowed the initial feature set to the following:

  • Up-to-the-minute news
  • Regular columnists (blogs)
  • Exclusive features
  • Reviews
  • Audio and video releases
  • Contests
  • Magazine articles/teasers
  • Subscription services
  • Community features

Next, we researched and assessed technology solutions that would best support the feature set.

Early in the assessment phase, we decided to use cascading style sheets (CSS). With CSS,we could create lighter and easier-to-manage web pages. By separating site design from sitecontent, we could lock down the design, but allow non-technical users to update content areas.Additionally, pages created with CSS are standards-based and offer greater accessibilityfor all users, including persons with disabilities, and allow pixel-level control over layoutfor designers. Plus, CSS allows us to target specific platforms like screens, printers,and PDAs.

Next, we had to decide which content management system (CMS) to use. We knew CMS was essentialbecause of the planned frequency of site updates. Multiple writers and editors would needto post and edit stories several times a day, every day. Plus, we knew the columnists (withtheir blogs) would be a big part of the new site. These bloggers are (or would become) majorpersonalities in the hop-hop journalism world—many of them already had their own Internetfollowings. Since this would be a central part of the redesign, blogging software becamea major consideration when evaluating CMS solutions.

After much consideration, we chose WordPress forour CMS. WordPress is a popular, open source, PHP-based blogging tool that has been aroundfor a while. In addition to allowing multiple bloggers to post, and users to comment on theposts, it offered many other features we were looking for "out of the box," such as talkbacks,RSS feeds, template systems, and, most importantly, an active developer community with hundredsof easily implemented plug-ins. These plug-ins quickly enabled essential features, includingFlash video, Send to a Friend links, automatic relevant post links, and intelligent caching.

As designers, we were also attracted to WordPress's template selection hierarchy. We setit up so that when WordPress looks for a category page, it looks for category-(number).php,in which "number" is the number of the category. If it does not find a specific categorypage, it goes a step more generic and looks for the category.php template. If it cannot findthat file it goes even more generic and looks for the archive.php file:

  1. category-6.php
  2. category.php
  3. archive.php
  4. index.php

In this way, a designer can customize as much or as little of the site as he or she wishes.Each of the sections can look entirely different. So in our case we have:

  1. category-3.php
  2. category.php
  3. index.php

This tiered system of templates allows XXLmag.com to have different layouts for different sections while keeping the numbers of files that need to be managed to a minimum.

Creating and integrating CSS

Lastly, we needed a tool that would help us create CSS and integrate CSS and WordPress together. We selected Adobe's Macromedia Dreamweaver 8.

Dreamweaver is one of our favorite development tools at Harris Publications. Our web team manages 11 sites and another 32 subscription/order mini-sites, which add up to tens of thousands of static HTML pages. We have to design, code, update, and manage them on a day-to-day basis while at the same time creating new sites and redesigning old ones. It is no exaggeration to say Dreamweaver doesn't just make it easy, Dreamweaver makes it possible.

In fact, Dreamweaver's code hinting feature, which auto-completes the code as you type, saves us 10-15 seconds for each line of code we write: multiply that by hundreds of lines of code a day and thousands per week, and you'll quickly see that this one feature saves us weeks of time over a year.

In addition to code hints, Dreamweaver features like templates, plug-ins, the integrated CSS palette, the ability to record repetitive tasks, find-and-replace functionality, background FTP, and code views, save us even more time. Seriously, without these Dreamweaver features, we'd have to add another two to three producers to our team in order to maintain our site.

Implementation

Once we determined our feature set and had the technology in place, we were ready to design and implement the new XXLmag.com site. I've broken the design process down into four steps: Do the math, Design, Deconstruct, and Dreamweaver. We'll go into detail on each below.

Do the math

I always start by sketching the site design out on paper. What may look like a step left over from art school is actually an essential tool in understanding the site (see Figure 3). CSS is all about simple math.

Sketch of the site design
Figure 3. Sketch of the site design

At its most basic, CSS is about defining an area, like the header or footer, and defining that area's height and width, then adding margins, paddings, and borders. This process is widely referred to as the CSS box method. The more math you work out ahead of time, the easier writing the CSS will be.

For XXLmag.com, we knew we had to accommodate standard industry ad sizes like the medium rectangle (300 x 250), leaderboard (728 x 90), banner (468 x 60), and wide skyscraper (160 x 600). A three-column grid on the home page and a second three-column grid on the interior pages worked best for our ads and content. We wanted to keep the width of the site at 800 pixel, so it would fit comfortably in the largest number of screens possible, but because of our ads, we ended up with an 808-pixel-wide site.

Design

Once we worked out the math and structured our site layout, we began the design process by applying graphics, color, fonts, and content in Adobe Illustrator CS2. We use Illustrator to lay out the sites because it allows us to quickly work with blocks of text, color, and images and makes duplicating sections and moving elements around on the page a painless experience. Image masks, layers, and the small size of vector-based files also aid in the quick development of site designs.

After the site design has been finalized we move the entire site into Adobe Photoshop CS2 to deconstruct it. This means we break the entire site down into the fewest number of graphics at the smallest file size possible. For example, the headline section on the left of the site only needs the top “XXL Headlines” tab with a small corner of green because the rest of the section with the green background and light green border can easily be recreated in Dreamweaver with CSS borders and background styles (see Figure 4).

Headlines tab
Figure 4. Headlines tab

Dreamweaver

With the design done, the math worked out, and our image building blocks ready to go, we now get to put it all back together with CSS using Dreamweaver 8. CSS can be internal in the HTML or saved as an external CSS file. For development purposes, I prefer internal CSS, which I then export to an external CSS file for the entire site to use once testing has been completed. Having a single external CSS file for the site makes making global changes to the site quick and easy.

When creating the actual CSS of CSS-based design, we like to work from the outside in (see Figure 5).

 CSS ID selectors for the home page
Figure 5. CSS ID selectors for the home page

Working from the outside of the site, the CSS for the XXL home page looks like this:

  1. <body>
  2. wrapper
  3. header
  4. siteBody
  5. footer

We use ID selectors for these sections because they are overall positioning of major site elements and only occur once per page. Generally, class selectors are used more for multiply occurring elements and for styling elements than for positioning elements.

The HTML looks like this:

<!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=ISO-8859-1" /> <title>XXL</title> </head> <body> <div id="wrapper"> <div id="header"></div> <div id="siteBody"></div> <div id="footer"></div> </div> </body> </html>

The CSS for these sections is easy to create because we already know the math for our elements. The wrapper div is 808 pixels wide and will contain the entire site. This div will also center our page on the user's screen. To do this, we'll first apply some CSS styles to the body tag, which is above our wrapper div in the site's hierarchy:

body { text-align: center; margin: 0px; padding: 0px; }

By aligning the text to center, I'm causing my wrapper div (and all elements contained within it) to be centered; therefore, I need to realign all the elements within my wrapper div to the left:

#wrapper { text-align: left; width: 808px; margin-right: auto; margin-left: auto; }

The left and right auto margins are used to ensure the wrapper div is centered in more recent CSS-compliant browsers like Firefox, while the align-center style on the body tag centers the wrapper div on older browsers like Internet Explorer 5.

The header and siteBody div do not have any actual styles and exist only to divide and hold the content that I'll place inside. The footer div gets some margins and different default text color:

#footer { text-align: center; margin-top: 10px; margin-bottom: 10px; color: #4f4228; }

After the basic framework is in place, we begin at the top and work our way down, filling in more detailed positioning:

<!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=ISO-8859-1" /> <title>XXL</title> </head> <body> <div id="wrapper"> <div id="header"> <div id="topLeaderboard"></div> <div id="subscribeNav"></div> <img src="xxl-magazine-website.gif" alt="XXLmag.com" width="265" height="75"/> <div id="searchXXL"></div> <div id="siteNav"></div> </div> <div id="siteBody"></div> <div id="footer"></div> </div> </body> </html>

The CSS for topLeaderboard id selector could not be easier. The section's width is 808 pixels, which is defined by our wrapper so we didn't need to add that again. The height is 110 pixels, which is the height of the background gradient we want to add. Using the Dreamweaver CSS panel, I add the background image with a horizontal repeat.

I'll add some padding so our ad banner, which is 90 pixels high, does not bump against the top of the browser, and I'll align the banner in the center.

The CSS looks like this:

#topLeaderboard { background-image: url(top-background.gif); background-repeat: repeat-x; text-align: center; height: 110px; padding-top: 5px; }

The only addition to the HTML is our ad systems code placed within the topLeaderboard div tag.

For the subscribeNav and siteNav sections, we're going to use ordered lists to hold the links. This method is considered a best practice for navigation. An ordered list can be displayed horizontally or vertically, it provides several tags to apply styles to, and it downgrades well in non-CSS environments—a bulleted list of links still works well as an understandable navigation:

<div id="header"> <div id="topLeaderboard"> ( ad system code ) </div> <div id="subscribeNav"> <ul> <li><a href="#">Customer Service</a></li> <li>|</li> <li><a href="#”>Give a Gift Subscription</a></li> <li><a href="#”><img src="subscribe.gif" alt="Subscribe to XXL" width="161" height="17" border="0" /></a></li> </ul> </div> <img src="xxl-magazine-website.gif" alt="XXLmag.com" width="265" height="75"/> <div id="searchXXL"> ( google search code ) </div> <div id="siteNav"> <ul> <li><a href="#"><img src="nav-headlines.gif" alt="headlines" width="62" height="9" border="0" /></a></li> <li><a href="#"><img src="nav-features.gif" alt="features" width="56" height="9" border="0" /></a></li> <li><a href="#"><img src="nav-the-leak.gif" alt="the leak" width="53" height="9" border="0" /></a></li> <li><a href="#"><img src="nav-columnists.gif" alt="columnnists" width="72" height="9" bor-der="0" /></a></li> <li><a href="#"><img src="nav-the-stash.gif" alt="the stash" width="60" height="9" border="0" /></a></li> <li><a href="#"><img src="nav-xxl-magazine.gif" alt="XXL Magazine" width="83" height="9" bor-der="0" /></a></li> <li><a href="#"><img src="nav-eye-candy.gif" alt="Eye Candy" width="60" height="9" border="0" /></a></li> <li><a href="#"><img src="nav-reviews.gif" alt="reviews" width="56" height="9" border="0" /></a></li> <li><a href="#"><img src="nav-community.gif" alt="Community" width="70" height="9" bor-der="0" /></a></li> </ul> </div> </div>

With both the subscribeNav and siteNav lists we need to first remove the bullets, padding, and vertical listing that unordered lists have by default. This is accomplished quickly and easily with CSS. Once that is done, I use the <li> tag to display the links horizontally and the <a> tag to style the navigation. In the case of the XXLmag.com siteNav, I used images instead of text links to retain a typographical connection to the brand.

The CSS for subscribeNav looks like this:

subscribeNav { float: right; font-weight: bold; color: #d1c2a5; text-align: right; height: 17px; } #subscribeNav ul { margin: 0px; padding: 0px; } #subscribeNav li { margin: 0px; padding: 0px 0px 0px 5px; list-style-type: none; display: inline; line-height: 17px; } #subscribeNav img { vertical-align: bottom; } #subscribeNav a { text-decoration: none; color: #d1c2a5; }

I used floats to position the subscribeNav and XXLsearch sections on the left. Floats take the section out of the normal flow of HTML, which gives me more flexibility in how they are positioned. I can align one with the top of the XXLmag.com logo and the other at the bottom.

The siteNav CSS looks much the same as the subscribeNav with some additional design elements added. The black background, green border, and white corner tab effect are all added in CSS:

#siteNav { text-align: center; margin-bottom: 10px; clear: both; background-color: #000000; border: 4px solid #888d76; } #siteNav ul { margin: 0px; padding:0px; } #siteNav li { list-style-type: none; display: inline; margin-top: 0px; margin-bottom: 0px; } #siteNav a img { background-image: url(nav-background.gif); background-repeat: no-repeat; background-position: right; background-color: #000000; padding-top: 6px; padding-right: 12px; padding-bottom: 6px; padding-left: 4px; margin-left: -4px; margin-bottom: -2px; margin-top:-4px; }

Now that the top section is complete, let's take a closer look at our main section, siteBody. Working from the inside out I separated the content within the siteBody into several smaller sections. Each of these sections contains a specific type of content, and each will hold several more smaller sections within it.

Our site structure now looks like this:

<body> wrapper header topLeaderboard subscibeNav logo graphic XXLsearch siteNav siteBody leftColumn features updates itunesWrapper footer

Each of these subsections of siteBody is further broken down into smaller divs based on the position or style requirements. For example, the XXLnow div within the features div floats the column to the right, so I needed to create another div, XXLnavTitle for my title graphic that loads the title as a background graphic and creates the black horizontal rule on the bottom.

The complex positioning of elements in the update section required even more internal divs for positioning than the features section. However, systematically breaking it down top-to-bottom makes it easy to create. This is why planning everything out before you sit down to write the CSS is so important.

The final section of the XXLmag.com is the top 10 list that we pull in from iTunes. I've taken an RSS feed of the top 10 hip-hop albums and the top 10 hip-hop songs. This list is up-to-the-minute accurate with what is selling on iTunes. I used CSS to style the incoming RSS feed to look like it comes from iTunes to ensure users know it is not XXL saying these songs and albums are the best.

With the CSS in place and the home page of the new XXL site created, I just had the final step of integrating the design and CSS with our WordPress back-end CMS. I wanted the home page to live outside the normal WordPress file structure but still post data from the WordPress content, so I couldn't start with an existing template page as I did for the interior pages of XXLmag.com. WordPress's flexible architecture makes this task simple. WordPress works with what it refers to as “the loop," which is used to display each of the posts. The loop formats each post based on specified criteria within the loop. Also, any HTML placed within the loop will be displayed with each post. To add the loop to any page on your site, the page just needs to be a .php file and know where the wp-blog-header.php file resides in relation to the page you want to add the loop to.

For the XXL homepage I added:

<?php require('online/wp-blog-header.php'); ?> <?php endforeach; ?>

Next I added an HTML list item tag so each of the seven headlines goes on its own line and displays the graphic bullet I previously defined in the CSS. I also inserted a WordPress permalink tag so the headlines would link back to the appropriate news story (see Figure 6):

<?php $posts = get_posts('numberposts=7&category=16'); foreach($posts as $post) : ?> <li><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"> <?php the_title(); ?> </a></li> <?php endforeach; ?>
 Home page with dummy text removed and WordPress loops placed into the layout
Figure 6. Home page with dummy text removed and WordPress loops placed into the layout

Creating the PHP calls that form the WordPress loop was made easier by the Dreamweaver extension TAGStention. This extension adds a toolbar to Dreamweaver that provides drag-and-drop basic loops and insert headers. It also has wizards for tags with parameters and Help buttons that refer you to WordPress extensive codex.

The results of the XXLmag.com redesign have exceeded our projections. Page views have more than tripled, unique visitors have doubled, and repeat traffic has soared. Users are going deeper into the site and are directly interacting with the content. Advertisers have seen increases in ad views and improved response rates. Furthermore, major advertisers who have never been interested in the magazine before have now begun advertising on the site.

As for the web team, we did it all without increasing headcount, which clearly demonstrates that careful planning along with selecting the right tools and technology, can turn a small web team into a powerful production force.

More Like This

  • Turning a design into HTML and CSS using the Fireworks to Dreamweaver workflow – Part 2: Modifying the HTML and CSS
  • Working with Drupal in Dreamweaver CS5
  • Styling and inserting a Spry Menu Bar 2.0 widget with the Adobe Widget Browser
  • Turning a design into HTML and CSS using the Fireworks to Dreamweaver workflow – Part 1: Exporting the design
  • HTML5 and CSS3 in Dreamweaver CS5.5 – Part 3: Using CSS media queries to target different screen resolutions
  • HTML5 and CSS3 in Dreamweaver CS5.5 – Part 2: Styling the web page
  • Understanding Spry basics
  • Getting to know your CSS selectors – Part 1: CSS2.1 and attribute selectors
  • Excerpt: Bring Your Web Design to Life
  • Getting to know your CSS selectors – Part 2: CSS3 pseudo-classes and pseudo-elements

Tutorials and samples

Tutorials

  • Understanding HTML5 semantics: Changed and absent elements
  • Mobile app with PhoneGap: Submitting to the Apple App Store
  • PhoneGap and Dreamweaver: Releasing on iOS
  • Mobile app with PhoneGap: Submitting to Android Market

Samples

  • Responsive design with jQuery marquee
  • Customizable starter design for jQuery Mobile
  • Customizable starter design for HTML5 video
  • Customizable starter design for multiscreen development

Dreamweaver user forum

More
04/23/2012 Resolution/Compatibility/liquid layout
04/20/2012 using local/testing server with cs5 inserting images look fine in the split screen but do not show
04/18/2012 Ap Div help
04/23/2012 Updating

Dreamweaver Cookbook

More
11/07/2011 Simple social networking share buttons
09/20/2011 Registration form that will generate email for registrant to validate
08/21/2011 Spry Accordion - Vertical Text - Auto Start on Page Load - Mouse Over Pause
08/17/2011 Using cfdump anywhere you like

Products

  • Acrobat
  • Creative Cloud
  • Creative Suite
  • Digital Marketing Suite
  • Digital Publishing Suite
  • Elements
  • Mobile Apps
  • Photoshop
  • Touch Apps
  • Student and Teacher Editions

Solutions

  • Digital marketing
  • Digital media
  • Web Experience Management

Industries

  • Education
  • Financial services
  • Government

Help

  • Product help centers
  • Orders and returns
  • Downloading and installing
  • My Adobe

Learning

  • Adobe Developer Connection
  • Adobe TV
  • Training and certification
  • Forums
  • Design Center

Ways to buy

  • For personal and home office
  • For students, educators, and staff
  • For small and medium businesses
  • For businesses, schools, and government
  • Special offers

Downloads

  • Adobe Reader
  • Adobe Flash Player
  • Adobe AIR
  • Adobe Shockwave Player

Company

  • News room
  • Partner programs
  • Corporate social responsibility
  • Career opportunities
  • Investor Relations
  • Events
  • Legal
  • Security
  • Contact Adobe
Choose your region United States (Change)
Choose your region Close

North America

Europe, Middle East and Africa

Asia Pacific

  • Canada - English
  • Canada - Français
  • Latinoamérica
  • México
  • United States

South America

  • Brasil
  • Africa - English
  • Österreich - Deutsch
  • Belgium - English
  • Belgique - Français
  • België - Nederlands
  • България
  • Hrvatska
  • Česká republika
  • Danmark
  • Eastern Europe - English
  • Eesti
  • Suomi
  • France
  • Deutschland
  • Magyarország
  • Ireland
  • Israel - English
  • ישראל - עברית
  • Italia
  • Latvija
  • Lietuva
  • Luxembourg - Deutsch
  • Luxembourg - English
  • Luxembourg - Français
  • الشرق الأوسط وشمال أفريقيا - اللغة العربية
  • Middle East and North Africa - English
  • Moyen-Orient et Afrique du Nord - Français
  • Nederland
  • Norge
  • Polska
  • Portugal
  • România
  • Россия
  • Srbija
  • Slovensko
  • Slovenija
  • España
  • Sverige
  • Schweiz - Deutsch
  • Suisse - Français
  • Svizzera - Italiano
  • Türkiye
  • Україна
  • United Kingdom
  • Australia
  • 中国
  • 中國香港特別行政區
  • Hong Kong S.A.R. of China
  • India - English
  • 日本
  • 한국
  • New Zealand
  • 台灣

Southeast Asia

  • Includes Indonesia, Malaysia, Philippines, Singapore, Thailand, and Vietnam - English

Copyright © 2012 Adobe Systems Incorporated. All rights reserved.

Terms of Use | Privacy Policy and Cookies (Updated)

Ad Choices

Reviewed by TRUSTe: site privacy statement