Extract CSS | Illustrator

  1. Illustrator User Guide
  2. Get to know Illustrator
    1. Introduction to Illustrator
      1. What's new in Illustrator
      2. Common questions
      3. Illustrator system requirements
      4. Illustrator for Apple silicon
    2. Workspace
      1. Workspace basics
      2. Create documents
      3. Tools Default keyboard shortcuts | Illustrator
      4. Tool galleries
      5. Customize keyboard shortcuts
      6. Artboards
      7. Customize the workspace
      8. Properties panel
      9. Set preferences
      10. Touch Workspace
      11. Microsoft Surface Dial support in Illustrator
      12. Recovery, undo, and automation
      13. Rotate view
      14. Rulers, grids, and guides
      15. Accessibility in Illustrator
      16. Safe Mode
      17. View artwork
      18. Use the Touch Bar with Illustrator
      19. Files and templates
      20. Synchronize settings using Adobe Creative Cloud
  3. Illustrator on the iPad
    1. Introduction to Illustrator on the iPad
      1. Illustrator on the iPad overview
      2. Illustrator on the iPad FAQs
      3. System requirements | Illustrator on the iPad
      4. What you can or cannot do on Illustrator on the iPad
    2. Workspace
      1. Illustrator on the iPad workspace
      2. Touch shortcuts and gestures
      3. Keyboard shortcuts for Illustrator on the iPad
      4. Manage your app settings
    3. Documents
      1. Work with documents in Illustrator on the iPad
      2. Import Photoshop and Fresco documents
    4. Select and arrange objects
      1. Create repeat objects
      2. Blend objects
    5. Drawing
      1. Draw and edit paths
      2. Draw and edit shapes
    6. Type
      1. Work with type and fonts
      2. Create text designs along a path
      3. Add your own fonts
    7. Work with images
      1. Vectorize raster images
    8. Color
      1. Apply colors and gradients
  4. Cloud documents
    1. Basics
      1. Work with Illustrator cloud documents
      2. Share and collaborate on Illustrator cloud documents
      3. Upgrade cloud storage for Adobe Illustrator
      4. Illustrator cloud documents | Common questions
    2. Troubleshooting
      1. Troubleshoot create or save issues for Illustrator cloud documents
      2. Troubleshoot Illustrator cloud documents issues
  5. Add and edit content
    1. Drawing
      1. Drawing basics
      2. Edit paths
      3. Draw pixel-perfect art
      4. Draw with the Pen, Curvature, or Pencil tool
      5. Draw simple lines and shapes
      6. Image Trace
      7. Simplify a path
      8. Define perspective grids
      9. Symbolism tools and symbol sets
      10. Adjust path segments
      11. Design a flower in 5 easy steps
      12. Perspective drawing
      13. Symbols
      14. Draw pixel-aligned paths for web workflows
    2. 3D effects and Adobe Substance materials
      1. About 3D effects in Illustrator
      2. Create 3D graphics
      3. Create 3D objects
      4. Create 3D Text
    3. Color
      1. About color
      2. Select colors
      3. Use and create swatches
      4. Adjust colors
      5. Use the Adobe Color Themes panel
      6. Color groups (harmonies)
      7. Color Themes panel
      8. Recolor your artwork
    4. Painting
      1. About painting
      2. Paint with fills and strokes
      3. Live Paint groups
      4. Gradients
      5. Brushes
      6. Transparency and blending modes
      7. Apply stroke on an object
      8. Create and edit patterns
      9. Meshes
      10. Patterns
    5. Select and arrange objects
      1. Select objects
      2. Layers
      3. Group and expand objects
      4. Move, align, and distribute objects
      5. Stack objects    
      6. Lock, hide, and delete objects
      7. Duplicate objects
      8. Rotate and reflect objects
    6. Reshape objects
      1. Crop images
      2. Transform objects
      3. Combine objects
      4. Cut, divide, and trim objects
      5. Puppet Warp
      6. Scale, shear, and distort objects
      7. Blend objects
      8. Reshape using envelopes
      9. Reshape objects with effects
      10. Build new shapes with Shaper and Shape Builder tools
      11. Work with Live Corners
      12. Enhanced reshape workflows with touch support
      13. Edit clipping masks
      14. Live shapes
      15. Create shapes using the Shape Builder tool
      16. Global editing
    7. Type
      1. Create text
      2. Fonts and typography
      3. Format type
      4. Import and export text
      5. Format paragraphs
      6. Special characters
      7. Create type on a path
      8. Character and paragraph styles
      9. Tabs
      10. Text and type
      11. Find missing fonts (Typekit workflow)
      12. Update text from Illustrator 10
      13. Arabic and Hebrew type
      14. Fonts | FAQ and troubleshooting tips
      15. Create 3D text effect
      16. Creative typography designs
      17. Scale and rotate type
      18. Line and character spacing
      19. Hyphenation and line breaks
      20. Text enhancements
      21. Spelling and language dictionaries
      22. Format Asian characters
      23. Composers for Asian scripts
      24. Create text designs with blend objects
      25. Create a text poster using Image Trace
    8. Create special effects
      1. Work with effects
      2. Graphic styles
      3. Create a drop shadow
      4. Appearance attributes
      5. Create sketches and mosaics
      6. Drop shadows, glows, and feathering
      7. Summary of effects
    9. Web graphics
      1. Best practices for creating web graphics
      2. Graphs
      3. SVG
      4. Create animations
      5. Slices and image maps
  6. Import, export, and save
    1. Import
      1. Import artwork files
      2. Import bitmap images
      3. Import artwork from Photoshop
      4. Place multiple files | Illustrator CC
      5. Unembed images
      6. Import Adobe PDF files
      7. Import EPS, DCS, and AutoCAD files
      8. Links information
    2. Creative Cloud Libraries in Illustrator 
      1. Creative Cloud Libraries in Illustrator
    3. Save
      1. Save artwork
    4. Export
      1. Use Illustrator artwork in Photoshop
      2. Export artwork
      3. Collect assets and export in batches
      4. Package files
      5. Create Adobe PDF files
      6. Extract CSS | Illustrator CC
      7. Adobe PDF options
      8. File information and metadata
  7. Printing
    1. Prepare for printing
      1. Set up documents for printing
      2. Change the page size and orientation
      3. Specify crop marks for trimming or aligning
      4. Get started with large canvas
    2. Printing
      1. Overprint
      2. Print with color management
      3. PostScript printing
      4. Print presets
      5. Printer's marks and bleeds
      6. Print and save transparent artwork
      7. Trapping
      8. Print color separations
      9. Print gradients, meshes, and color blends
      10. White Overprint
  8. Automate tasks
    1. Data merge using the Variables panel
    2. Automation with scripts
    3. Automation with actions
  9. Troubleshooting 
    1. Crash on launch issues
    2. Recover files after crash
    3. File issues
    4. GPU device driver issues
    5. Wacom device issues
    6. DLL file issues
    7. Memory issues
    8. Preferences file issues
    9. Font issues
    10. Printer issues
    11. Share crash report with Adobe

You can create the design for an HTML page in Illustrator. This serves as a good visual guide for a Web Developer who can then code the layout, styles, and objects into a page in an HTML editor. However, replicating the exact appearance and position of components and objects is a time-consuming and tedious process.

With Illustrator, when you create the layout for an HTML page, you can also generate and export the underlying CSS code that determines the appearance of the components and objects on the page. CSS allows you to control the appearance of text and objects (similar to character and graphic styles). You can choose to export the CSS code for individual objects, or for the entire layout designed in Illustrator.   

The CSS Properties panel (Window > CSS Properties) let users do following:

  • View the CSS code for selected objects
  • Copy the CSS code for selected objects
  • Export one or more, or all selected Illustrator elements to a CSS file
  • Export rasterizable images used
  • Generate browser-specific CSS code

View and extract CSS code

Note:

To generate CSS code, do one of the following:

  • Ensure that objects in your Illustrator document are named in the Layer's panel.
  • Click Window > CSS Properties > flyout menu > Export Options, and select the Generate CSS for Unnamed Objects check box. 
  1. Select Window > CSS Properties.

    CSS Properties code

    A. Warning, if some styles could not be converted to CSS code B. CSS Export Options dialog box C. Export Selected CSS to file D. Copy Selected Style to the clipboard E. Generate CSS F. Flyout menu G. Styles used in the selected objects H. CSS code 

  2. In an open Illustrator document, do one of the following:

    • Select one object. The CSS code for the object is displayed in the CSS Properties panel.
    • Hold Shift, select multiple objects, and then click the Generate CSS button in the CSS Properties panel.
    • Press Ctrl/Cmd + A to select all the objects, and then click the Generate CSS button in the CSS Properties panel.

    The generated CSS code is displayed.

  3. To obtain the CSS code that has been generated, do one of the following:

    • To copy selected code, select specific code, and then:
      • To copy to the clipboard, click Copy Selected Style
      • To export to a file, click the flyout menu, and then click Export Selected CSS
    • To copy all the code, make no selection in the CSS code, and then:
      • To copy to the clipboard, click Copy Selected Style
      • To export to a file, click the flyout menu, and then click Export All
  4. While saving CSS code to a file, choose from the following options:

    CSS export options

    Note:

    To modify the content of the CSS code that is generated, in the CSS Properties panel, click Export Options, and then make the appropriate selections.

Sample CSS Code

Rectangle with a gradient applied (all browsers)

.GRADIENT_BOX
{
  background : -moz-linear-gradient(0% 50% 0deg,rgba(255, 242, 0, 1) 0%,rgba(254, 236, 1, 1) 10.31%,rgba(253, 218, 4, 1) 24.34%,rgba(251, 190, 9, 1) 40.51%,rgba(247, 150, 15, 1) 58.28%,rgba(243, 99, 24, 1) 77.37%,rgba(238, 37, 34, 1) 97.27%,rgba(237, 28, 36, 1) 100%);
  background : -webkit-linear-gradient(0deg, rgba(255, 242, 0, 1) 0%, rgba(254, 236, 1, 1) 10.31%, rgba(253, 218, 4, 1) 24.34%, rgba(251, 190, 9, 1) 40.51%, rgba(247, 150, 15, 1) 58.28%, rgba(243, 99, 24, 1) 77.37%, rgba(238, 37, 34, 1) 97.27%, rgba(237, 28, 36, 1) 100%);
  background : -webkit-gradient(linear,0% 50% ,100% 50% ,color-stop(0,rgba(255, 242, 0, 1) ),color-stop(0.1031,rgba(254, 236, 1, 1) ),color-stop(0.2434,rgba(253, 218, 4, 1) ),color-stop(0.4051,rgba(251, 190, 9, 1) ),color-stop(0.5828,rgba(247, 150, 15, 1) ),color-stop(0.7737,rgba(243, 99, 24, 1) ),color-stop(0.9727,rgba(238, 37, 34, 1) ),color-stop(1,rgba(237, 28, 36, 1) ));
  background : -o-linear-gradient(0deg, rgba(255, 242, 0, 1) 0%, rgba(254, 236, 1, 1) 10.31%, rgba(253, 218, 4, 1) 24.34%, rgba(251, 190, 9, 1) 40.51%, rgba(247, 150, 15, 1) 58.28%, rgba(243, 99, 24, 1) 77.37%, rgba(238, 37, 34, 1) 97.27%, rgba(237, 28, 36, 1) 100%);
  background : -ms-linear-gradient(0deg, rgba(255, 242, 0, 1) 0%, rgba(254, 236, 1, 1) 10.31%, rgba(253, 218, 4, 1) 24.34%, rgba(251, 190, 9, 1) 40.51%, rgba(247, 150, 15, 1) 58.28%, rgba(243, 99, 24, 1) 77.37%, rgba(238, 37, 34, 1) 97.27%, rgba(237, 28, 36, 1) 100%);
  -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFF200', endColorstr='#ED1C24' ,GradientType=0)";
  background : linear-gradient(90deg, rgba(255, 242, 0, 1) 0%, rgba(254, 236, 1, 1) 10.31%, rgba(253, 218, 4, 1) 24.34%, rgba(251, 190, 9, 1) 40.51%, rgba(247, 150, 15, 1) 58.28%, rgba(243, 99, 24, 1) 77.37%, rgba(238, 37, 34, 1) 97.27%, rgba(237, 28, 36, 1) 100%);
  border-style : Solid;
  border-color : #231F20;
  border-color : rgba(35, 31, 32, 1);
  border-width : 1px;
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFF200',endColorstr='#ED1C24' , GradientType=1);
}

Rectangle with a gradient applied (webkit-based browsers only)

.GRADIENT_BOX
{
  background : -webkit-linear-gradient(0deg, rgba(255, 242, 0, 1) 0%, rgba(254, 236, 1, 1) 10.31%, rgba(253, 218, 4, 1) 24.34%, rgba(251, 190, 9, 1) 40.51%, rgba(247, 150, 15, 1) 58.28%, rgba(243, 99, 24, 1) 77.37%, rgba(238, 37, 34, 1) 97.27%, rgba(237, 28, 36, 1) 100%);
  background : -webkit-gradient(linear,0% 50% ,100% 50% ,color-stop(0,rgba(255, 242, 0, 1) ),color-stop(0.1031,rgba(254, 236, 1, 1) ),color-stop(0.2434,rgba(253, 218, 4, 1) ),color-stop(0.4051,rgba(251, 190, 9, 1) ),color-stop(0.5828,rgba(247, 150, 15, 1) ),color-stop(0.7737,rgba(243, 99, 24, 1) ),color-stop(0.9727,rgba(238, 37, 34, 1) ),color-stop(1,rgba(237, 28, 36, 1) ));
  background : linear-gradient(90deg, rgba(255, 242, 0, 1) 0%, rgba(254, 236, 1, 1) 10.31%, rgba(253, 218, 4, 1) 24.34%, rgba(251, 190, 9, 1) 40.51%, rgba(247, 150, 15, 1) 58.28%, rgba(243, 99, 24, 1) 77.37%, rgba(238, 37, 34, 1) 97.27%, rgba(237, 28, 36, 1) 100%);
  border-style : Solid;
  border-color : #231F20;
  border-color : rgba(35, 31, 32, 1);
  border-width : 1px;
}

Multiple objects

.NormalCharacterStyle
{
  font-family : Myriad Pro;
  font-size : 12px;
}
.st0
{
  border-style : Solid;
  border-color : #FFFFFF;
  border-color : rgba(255, 255, 255, 1);
  border-width : 0px;
}
.GRADIENT_BOX
{
  background : -webkit-linear-gradient(0deg, rgba(255, 242, 0, 1) 0%, rgba(254, 236, 1, 1) 10.31%, rgba(253, 218, 4, 1) 24.34%, rgba(251, 190, 9, 1) 40.51%, rgba(247, 150, 15, 1) 58.28%, rgba(243, 99, 24, 1) 77.37%, rgba(238, 37, 34, 1) 97.27%, rgba(237, 28, 36, 1) 100%);
  background : -webkit-gradient(linear,0% 50% ,100% 50% ,color-stop(0,rgba(255, 242, 0, 1) ),color-stop(0.1031,rgba(254, 236, 1, 1) ),color-stop(0.2434,rgba(253, 218, 4, 1) ),color-stop(0.4051,rgba(251, 190, 9, 1) ),color-stop(0.5828,rgba(247, 150, 15, 1) ),color-stop(0.7737,rgba(243, 99, 24, 1) ),color-stop(0.9727,rgba(238, 37, 34, 1) ),color-stop(1,rgba(237, 28, 36, 1) ));
  background : linear-gradient(90deg, rgba(255, 242, 0, 1) 0%, rgba(254, 236, 1, 1) 10.31%, rgba(253, 218, 4, 1) 24.34%, rgba(251, 190, 9, 1) 40.51%, rgba(247, 150, 15, 1) 58.28%, rgba(243, 99, 24, 1) 77.37%, rgba(238, 37, 34, 1) 97.27%, rgba(237, 28, 36, 1) 100%);
  border-style : Solid;
  border-color : #231F20;
  border-color : rgba(35, 31, 32, 1);
  border-width : 1px;
}
Adobe logo

Sign in to your account