New Feature: Playlist Center! Pick a topic and let our playlists guide the way.

Start learning with our library of video tutorials taught by experts. Get started

Illustrator CS5 for Web and Interactive Design
Illustration by

Exporting CSS and DIVs from an Illustrator layout


From:

Illustrator CS5 for Web and Interactive Design

with Mordy Golding

Video: Exporting CSS and DIVs from an Illustrator layout

It's rare nowadays that people actually build entire pages using HTML tables. Most people now are starting to use CSS for layout. One of the nice things about Illustrator's Save for Web & Devices feature is that it does support the export of a slice layout using CSS divs instead of an HTML table. Before we do that, however, I want to show you a few settings that you can put in place to make life a little bit easier later on. Now, we know that you can select slices here inside of Illustrator and then go to choose Object and then choose Slice and then Slice Options to change some of the settings for the slices, but I actually like to prefer to do that in the Save for Web & Devices dialog box.
Expand all | Collapse all
  1. 6m 56s
    1. Welcome
      1m 33s
    2. Choosing Illustrator for web and interactive design
      2m 54s
    3. Illustrator and the web design workflow
      2m 7s
    4. Using the exercise files
      22s
  2. 40m 9s
    1. Pixel dimension vs. resolution
      4m 14s
    2. Pixel Preview mode and anti-aliasing
      5m 39s
    3. Taking charge of anti-aliasing
      5m 27s
    4. Choosing the right color management settings
      7m 25s
    5. Setting up important preferences
      6m 22s
    6. Setting up a workspace optimized for web design
      11m 2s
  3. 54m 5s
    1. Using the Web document profile
      3m 39s
    2. Creating custom document profiles
      9m 38s
    3. Using Illustrator's free web templates
      2m 33s
    4. Creating a sitemap or wireframe
      2m 50s
    5. Setting up an entire web site
      9m 33s
    6. Setting up a grid
      10m 37s
    7. Setting up an online ad campaign
      8m 13s
    8. Setting up icons for iOS
      2m 24s
    9. Setting up mobile content with Adobe Device Central
      4m 38s
  4. 32m 22s
    1. Understanding web-safe colors
      11m 50s
    2. Limiting the Color Guide to web-safe colors
      4m 53s
    3. Using Recolor Art to convert art to web-safe colors
      4m 54s
    4. Getting color inspiration from Adobe Kuler
      6m 48s
    5. Using Recolor Artwork to modify colors across a site
      3m 57s
  5. 56m 54s
    1. Using the Save for Web & Devices feature
      6m 44s
    2. Understanding the GIF file format and its settings
      10m 20s
    3. Understanding the JPEG file format and its settings
      7m 39s
    4. Understanding the PNG file format and its settings
      3m 21s
    5. Understanding the WBMP file format and its settings
      1m 18s
    6. Understanding the SWF file format and its settings
      4m 13s
    7. Understanding the SVG file format and its settings
      3m 41s
    8. Adjusting the dimensions of a graphic
      4m 46s
    9. Optimizing files to a specific file size
      4m 5s
    10. Modifying Save for Web & Devices output settings
      6m 51s
    11. Previewing content in Adobe Device Central
      3m 56s
  6. 56m 6s
    1. Setting point type in Illustrator
      4m 11s
    2. Setting area type in Illustrator
      5m 20s
    3. Formatting text quickly with paragraph styles
      14m 39s
    4. Overriding formatting with character styles
      3m 2s
    5. Controlling text anti-aliasing
      4m 50s
    6. Simulating the CSS box model
      11m 14s
    7. Adding cool reflections to text and graphics
      8m 26s
    8. Applying settings quickly with Graphic Styles
      4m 24s
  7. 35m 56s
    1. Understanding the concept of slicing
      3m 22s
    2. Creating slices manually
      4m 26s
    3. Creating slices from guides
      2m 45s
    4. Creating slices from objects
      7m 33s
    5. Understanding the different slice types
      4m 20s
    6. Applying settings to slices
      9m 20s
    7. Creating hotspots with image maps
      4m 10s
  8. 23m 35s
    1. Exporting static SWF files from Illustrator
      3m 35s
    2. Animated SWF: Converting Illustrator layers to SWF frames
      4m 3s
    3. Animated SWF: Using blends to define motion
      8m 35s
    4. Animated SWF: Adding static artwork to an animation
      3m 24s
    5. Animated SWF: Controlling time within an animation
      3m 58s
  9. 17m 13s
    1. Preserving slices and structure with PSD export
      6m 10s
    2. Working with Photoshop Smart Objects
      4m 35s
    3. Sharing color swatches between Illustrator and Photoshop
      2m 52s
    4. Generating an animated GIF file with Photoshop
      3m 36s
  10. 7m 28s
    1. Exporting HTML from Illustrator for use in Dreamweaver
      3m 31s
    2. Exporting CSS and DIVs from an Illustrator layout
      3m 57s
  11. 12m 37s
    1. Moving art between Illustrator and Fireworks
      6m 25s
    2. Using dynamic shapes from Fireworks
      3m 48s
    3. Sharing color swatches between Illustrator and Fireworks
      2m 24s
  12. 16m 7s
    1. Building files for use in Flash Catalyst
      4m 28s
    2. Creating a new Flash Catalyst project from an Illustrator file
      3m 40s
    3. Copying and pasting artwork between Illustrator and Flash Catalyst
      2m 4s
    4. Roundtrip editing between Illustrator and Flash Catalyst
      3m 36s
    5. Creating Flex skins for use in Flash Builder
      2m 19s
  13. 19m 48s
    1. Understanding symbols: The lifeblood of Flash
      4m 58s
    2. Symbols: Understanding 9-slice scaling
      4m 18s
    3. Setting text that will be used in Flash Professional
      3m 5s
    4. Moving artwork between Illustrator and Flash Professional
      7m 27s
  14. 1m 6s
    1. Goodbye
      1m 6s

Watch this entire course now—plus get access to every course in the library. Each course includes high-quality videos taught by expert instructors.

Become a member
please wait ...
Illustrator CS5 for Web and Interactive Design
6h 20m Intermediate Sep 24, 2010

Viewers: in countries Watching now:

In Illustrator CS5 Web and Interactive Design, Mordy Golding shows how to create pixel-perfect graphics for use in web sites, video compositions, and mobile apps. This course covers a wide range of workflows, from creating online ad campaigns, web sites, icons, to taking art from Illustrator to Flash Professional. Sharing tips, tricks, and creative techniques along the way, Mordy provides insight and instruction for taking projects from initial concept straight through to production. Exercise files accompany the course.

Topics include:
  • Getting perfectly sized pixel graphics from Illustrator
  • Setting up preferences in Illustrator for web design
  • Creating custom document profiles
  • Getting great color on the web
  • Understanding web graphic file formats (GIF, JPG, PNG, SWF, and SVG)
  • Setting great-looking type
  • Slicing artwork for various tasks
  • Creating Flash animations directly from Illustrator
  • Working with Photoshop Smart Objects
  • Exporting HTML and CSS from Illustrator
  • Integrating with Flash Catalyst
Subjects:
Web Web Graphics Interaction Design Prototyping Web Design
Software:
Illustrator
Author:
Mordy Golding

Exporting CSS and DIVs from an Illustrator layout

It's rare nowadays that people actually build entire pages using HTML tables. Most people now are starting to use CSS for layout. One of the nice things about Illustrator's Save for Web & Devices feature is that it does support the export of a slice layout using CSS divs instead of an HTML table. Before we do that, however, I want to show you a few settings that you can put in place to make life a little bit easier later on. Now, we know that you can select slices here inside of Illustrator and then go to choose Object and then choose Slice and then Slice Options to change some of the settings for the slices, but I actually like to prefer to do that in the Save for Web & Devices dialog box.

So I am going to make sure that this artboard is currently the active one. This is the one that I want to export right here. I am going to choose File > Save for Web & Devices, and I'm going to zoom out just a little bit here. I'm pressing Command+Minus or Ctrl+Minus if you're on a Windows computer. And I'm going to use my Slice Select tool to simply double-click on a slice. Notice that opens up the Slice Options dialog box, and I have this slice set to a type of image, but the name of the slice I've renamed it to be called navigation. In fact, if I take a look at some of these other slices, like I double-click on this one, this one is called main.

This one on the top here is called header, and maybe this one over here is called sidebar_main. By naming my slices in this way, when this file actually does get exported using CSS divs, the slice names will be translated, and they will turn into the div names. This will make it much easier for me, or a developer, to understand how the code is written and which content belongs in each of these divs. So with my slice names in place, I can now go ahead and choose to save this, but instead of choosing the settings here for Default Settings, I'm going to modify these by choosing Other.

Now, in the HTML section of the Output Settings dialog box, I am going to turn on this option called Output XHTML. And I am going to switch over here to where it says Slices, and rather than generate an HTML table, I am going to have Illustrated generate CSS instead. I can have them referenced by ID, and like I said before, because I went ahead and I name though my slices, those slice names will become to div IDs for each of the divs that get created in the CSS. So now I'll click OK to save those settings. Let me go ahead and now navigate to Chapter 09 over here.

Let's create a new folder. I am going to call this one css, and instead of choosing to save all of my slices, I just really want to create divs for all the user slices. Those are the ones that I've created slices for. I don't really care about the other information that's there. I am going to click Save. So now I am going to switch over to Dreamweaver, and let's take a look at what this page looks like. I'll choose File > Open. Let's go ahead now and navigate up to the CSS folder here and choose to open up this site_design.html page. And if I go ahead and I go to Design View for a second here, you can see that the divs that I specified inside of Illustrator with slices now exist here inside of Dreamweaver.

And if I change to the Code View here or the Split View I can see that the names of all of my divs have come through as well. So because I've named my slices navigation, and header, and main, for example, those now become the names of the divs. Now, it's important to realize that the divs that are created right here or what we call AP divs or Absolute Positioned divs. Now, normally in a regular web design layout, when you start to learn about using CSS, most people don't use these types of divs unless they want artwork to be positioned in a certain specific location on a page.

However, Illustrator is still kind of in the graphic mode here, so it creates all these divs in the precise location that they were designed on the page, meaning that the divs themselves won't flow as you change the layout. In fact, if you scroll up here in the code, you can see that these divs that are created here have their position set to Absolute. Still, it's a way to take what you've created inside of Illustrator and quickly turn it into code that you might use inside of Dreamweaver. Once you're here in Dreamweaver, you can adjust the code as needed.

Find answers to the most frequently asked questions about Illustrator CS5 for Web and Interactive Design.


Expand all | Collapse all
please wait ...
Q: In the chapter 5 movie, "Simulating the CSS box model," the author details the CSS box, but names the inner portion the margin and the outer portion the padding. This is reversed from what I’ve have seen elsewhere. Is this an error in the video?
A: This video does indeed contain an error where the author describes the margin and padding. The padding should be described as the area inside the border, and the margin the area outside the border.
 
Share a link to this course

What are exercise files?

Exercise files are the same files the author uses in the course. Save time by downloading the author's files instead of setting up your own files, and learn by following along with the instructor.

Can I take this course without the exercise files?

Yes! If you decide you would like the exercise files later, you can upgrade to a premium account any time.

Become a member Download sample files See plans and pricing

Please wait... please wait ...
Upgrade to get access to exercise files.

Exercise files video

How to use exercise files.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.
Upgrade now


Exercise files

Exercise files video

How to use exercise files.

For additional information on downloading and using exercise files, watch our instructional video or read the instructions in the FAQ.

This course includes free exercise files, so you can practice while you watch the course. To access all the exercise files in our library, become a Premium Member.

join now Upgrade now

Are you sure you want to mark all the videos in this course as unwatched?

This will not affect your course history, your reports, or your certificates of completion for this course.


Mark all as unwatched Cancel

Congratulations

You have completed Illustrator CS5 for Web and Interactive Design.

Return to your organization's learning portal to continue training, or close this page.


OK
Become a member to add this course to a playlist

Join today and get unlimited access to the entire library of video courses—and create as many playlists as you like.

Get started

Already a member?

Become a member to like this course.

Join today and get unlimited access to the entire library of video courses.

Get started

Already a member?

Exercise files

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships. Learn more

Get started

Already a Premium member?

Exercise files video

How to use exercise files.

Ask a question

Thanks for contacting us.
You’ll hear from our Customer Service team within 24 hours.

Please enter the text shown below:

The classic layout automatically defaults to the latest Flash Player.

To choose a different player, hold the cursor over your name at the top right of any lynda.com page and choose Site preferencesfrom the dropdown menu.

Continue to classic layout Stay on new layout
Exercise files

Access exercise files from a button right under the course name.

Mark videos as unwatched

Remove icons showing you already watched videos if you want to start over.

Control your viewing experience

Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.

Interactive transcripts

Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.

Are you sure you want to delete this note?

No

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked
Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.