NHS Designs
Web Design Tutorials

Saving Photoshop Slices for the Web

Chapter 16 introduced a number of great features that Photoshop has for the Web designer. Where it left off, we will continue here with a lesson on how to take your sliced Photoshop mockups and actually create Web pages from then.

You can see images of a number of real-life Photoshop mockups I created for clients in the gallery.

Better yet, you can see my multi-layer Photoshop files in all their glory in the Outbox (Photoshop mockups folder).

 

Saving a Mockup for the Web, the Basics

Here are the steps for saving a Photoshop file for the Web once you've created slices and customized the slice names and destinations.

  1. Open up the Save for Web & Devices dialog box (File > Save for Web & Devices).
  2. Select each of the slices you defined and select whether it is best saved as a GIF or JPG file.
  3. Click Save.
  4. Select "HTML and images" from the "Save as type" dropdown.
  5. Give the .html file an appropriate name.
  6. Locate your Web site folder.
  7. Click Save.

 

Saving a Mockup for the Web, in Detail

  1. Create a fodler in My Documents called lastnamefirstinitial_global.
  2. Copy global_skin_design_3.psd from the Outbox (PEDERSEN\web design\Photoshop mockups\ globaltitle) and paste it into your lastnamefirstinitial_global folder.
  3. Rename the Photoshop file index.psd.
  4. Open index.psd. If you get a warning, click No.
  5. Slice Select toolSelect the Slice Select tool from the toolbox on the left side of the screen.
  6. We're going to rename some of the existing slices and give them URL destinations. Double-click on a slice with the Slice Select tool to enter this information for the specified slices. See the table below.

No.

Name

URL

Alt Tag

3

button-home

index.html

Home

6

button-login

login.html

Log In

7

button-services

services.html

Services

8

button-partners

partners.html

Partners

9

button-about

about.html

About Us

10

button-contact

contact.html

Contact Us

  1. Some slices are empty patches of white or color. For these an images is not necessary. To tell Photoshop not to create an image for a given slice, do the following:
    1. Double-click on the slice with the Slice Select tool.
    2. Change the Slice Type to "No Image".
    3. Click OK.
    Change the following slices to "No Image": 1, 2, 4, and 12 (12 has some text in it that should be entered in Dreamweaver rather than appear as an image.)
  2. Save the Photoshop file (Ctrl+S).
  3. Now Save for Web & Devices (Ctrl-Shift-Alt+S).
  4. Make sure the Slice Select tool is highlighted in the small tools panel on the left.
  5. Click on each slice on turn to assign it the appropriate file type. Use the table below:

No.

Preset

3

JPG High

6

JPG High

7

JPG High

8

JPG High

9

JPG High

10

JPG High

Don't worry about slices 1, 2, 4 and 12; remember, these will not result in images.

  1. Click on Save.
  2. Select "HTML and images" from the "Save as type" dropdown.
  3. Name the file index.html.
  4. Locate your lastnamefirstinitial_global folder.
  5. Click Save.
  6. Save the Photoshop file (Ctrl+S).
  7. Locate and double-click on the index.html file in your lastnamefirstinitial_global folder.
  8. Click on the images for which you created links. The menu items will have broken links, but that's okay for this lesson.
  9. If we're out of time, turn your lastnamefirstinitial_global folder into the Inbox. If not, move on to the next section on creating button rollovers.

 

Rollover Images (if there's time)

The Photoshop file you just worked with actually had rollover layers available for each of the menu buttons. We can use these to create rollover images and then code the rollovers in Dreamweaver.*

We're going to create the rollover images for this mockup and then code the rollovers in Dreamweaver.

  1. Save the Photoshop file as rollovers.psd (File > Save As...)
  2. Turn off the following layers by clicking the eyeball icon on the left of their layers:
    1. LOG IN
    2. SERVICES
    3. PARTNERS
    4. ABOUT US
    5. CONTACT US
  3. Turn on the following layers by clicking the black space where the eye icon goes on the left of their layers:
    1. LOG IN copy
    2. SERVICES copy
    3. PARTNERS copy
    4. ABOUT US copy
    5. CONTACT US copy
  4. For each of the slices below, double-click on it and change the Names as follows:

No.

Name

6

button-down-login

7

button-down-services

8

button-down-partners

9

button-down-about

10

button-down-contact

  1. Save the Photoshop file (Ctrl+S).
  2. Time to save for Web again! File > Sae for Web & Devices (Ctrl-Shift-Alt+S).
  3. Photoshop remembers the file types that each slice should be. Click Save.
  4. Change the "Save as Type" dropdown to "Images Only".
  5. You will see a Replace Files dialog box. You do not want to replace any of the existing images, just create the new ones (for slices 6 - 10 as above). Uncheck each of the files in the list. You can do this quickly by clicking-and-dragging from the top straight down through the checkmarks.
  6. Click Replace. Your rollover images have been created!
  7. Now we need to create the code for the rollover action. Start Dreamweaver.
  8. Open our new index.html file (File > Open).
  9. Click on the image for Log In. Hit the Delete key on your keyboard to remove it. We need to start from scratch for each button in order to create the rollovers.
  10. On the Insert Bar, make sure that Common is displayed.
  11. Click the dropdown arrow for Images and select Rollover image.
  12. Enter the data as shown below for the Log In button:

Button Image

Image name:

Original image:

Rollover image:

Alternate text:

URL:

"Log In"

login

button-
login.jpg

button-
down-
login.jpg

login

login.html

  1. Complete steps 15 & 16 for each of the remaining menu buttons.

Button Image

Image name:

Original image:

Rollover image:

Alternate text:

URL:

"Services"

services

button-
services.
jpg

button-
down-
services.
jpg

services

services.
html

"Partners"

partners

button-
partners.
jpg

button-
down-
partners.
jpg

partners

partners.
html

"About Us"

about

button-
about.
jpg

button-
down-
about.
jpg

about

about.
html

"Contact Us"

contact

button-
contact.
jpg

button-
down-
contact.
jpg

contact

contact.
html

  1. Save index.html (Ctrl+S).
  2. Press F12 to test the file in a browser. Verify that each of your rollovers works.
  3. Turn your lastnamefirstinitial_global folder into the Inbox.

 

* In earlier versions of Photoshop, it was bundled together with a program called ImageReady which was used for creating graphics for the Web. It was used to create simple animations and could even code rollover actions without the use of Dreamweaver. ImageReady no longer exists. Our version of Photoshop (CS3) now offers animation capabilities, but the rollover coding feature is no more.


ABOUT MRS. PEDERSEN · EMAIL MRS. PEDERSEN
resources · copyright information · Website designed by >