Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member

Copying CSS code from specialty layers

From: Photoshop CS6 New Features

Video: Copying CSS code from specialty layers

One of the more remarkable new features in Photoshop 13.1 is its ability to automatically generate CSS code. So you can take a text layer or a shape layer or entire group and copy the CSS code associated with it and then paste it into your web document. So it's a chance to have Photoshop do some of the work for you, instead of having to code everything by hand. Now this example that I am about to show you comes from my buddy Justin Seeley, who does the course Photoshop for Web Design at lynda.com.

Copying CSS code from specialty layers

One of the more remarkable new features in Photoshop 13.1 is its ability to automatically generate CSS code. So you can take a text layer or a shape layer or entire group and copy the CSS code associated with it and then paste it into your web document. So it's a chance to have Photoshop do some of the work for you, instead of having to code everything by hand. Now this example that I am about to show you comes from my buddy Justin Seeley, who does the course Photoshop for Web Design at lynda.com.

So a brief shout out to him. I am going to switch over to this document, and you can see that it's got this solid blue header, and there's no button around Buy Now. Whereas, if we go ahead and switch over to the mockup inside of Photoshop, you can see that Buy Now has a button around it and both it and the header have these red to dark red gradients. So what I am going to do here, the first thing you've got to do is confirm that Photoshop is ready to export the clipboard. This is very important. So press Ctrl+K or Command+K on the Mac to bring up the Preferences dialog box and turn on this check box right here, Export Clipboard.

Now it's on by default, but I normally recommend people turn it off, because otherwise you're copying these massive pixel-based images in Photoshop and then it's trying to offload those images to the clipboard, your system slows down, all kinds of problems can occur. But if you want to be able to copy and paste CSS, this check box has to be on. So go ahead and turn it on and then click OK. Then I'll go over to the Layers panel here, twirl open the header layer, and I got this shape layer right here called Header Bar. I am going to right-click on it. Your shortcut menu won't be such a mess. It's just that my screen is so short.

You'll find this command called Copy CSS. It's only available in the RGB mode, by the way, so if you happen to be working inside of CMYK document, it will be dimmed. Most of you aren't, but just so you know. I will go ahead and choose Copy CSS, and then I'll switchover to Dreamweaver where I have that source file open, the index.html file. Notice that it references this file called style.css. I'll go ahead and switch over to it, and what I want to do is edit this code down here that says header.

Currently, you can see background is set to the solid shade of blue. That's not what I want. Now we've already got our header tag in place here, so I just need to replace this background information. Photoshop has copied too much code for my purposes. So what I'm going to do is edit it down a little bit inside of a new document by going up to the File menu and choosing New. Then I want to create a new CSS document. So I will go ahead and select it and then click Create. Then I'll press Ctrl+V or Command+V on a Mac to paste all of that code. Notice in addition to this header bar tag there, I've got the background information which is what I want. I also have this positioning information.

It's very unlikely you're ever going to find this useful. So you will probably want to take it out. However, it does represent Photoshop's best guess for positioning info. Anyway, I am going to go ahead and just select these two lines right there. Then I'll copy by pressing Ctrl+C or Command+C on the Mac, then I'll switch back to my index.html file. I'm still actually looking at the contents of style.css. I'll go ahead and select the existing background information, and I'll press Ctrl+V or Command+V on the Mac in order to paste it in there, and then I'll go up to the File menu, and I'll choose the Save command.

Now if I switch back to my browser, which happens to be Chrome, and I go ahead and update the contents of this page, you will see that I've now got the gradient header. Now let's take care of the Buy Now button. I will go ahead and switch back to Photoshop, and I'll twirl open the Content group in this case. Scroll my way down to this item right here called button, right-click on it, and once again choose Copy CSS. Now I'll return to Dreamweaver, and I need to scroll all the way to the bottom of my CSS document, down here to line 123.

So I'm clicking after this existing btn_text tag, and I'll press Ctrl+V or Command+V on a Mac to create an entirely new tag, as you can see, right here. The thing is I don't want that position info. I'll go ahead and show you what that looks like just so you know. I'll go up to the File menu and choose the Save command and then I'll switch over to Chrome, and I will go ahead and reload the page, and you can see that Photoshop's best guess for where the Buy Now button goes is entirely wrong. So let's go ahead and strip out that information by grabbing these three lines right here, position, left, and top.

Then I'll press the Backspace key or the Delete key on the Mac to get rid of them, and I'll switch over for a final time to Chrome, and I will click on the Refresh button, and you can see that the Buy Now button is now where it needs to be. That friends is how you copy and employ CSS code that's automatically generated by Photoshop 13.1.

Show transcript

This video is part of

Image for Photoshop CS6 New Features
Photoshop CS6 New Features

38 video lessons · 41770 viewers

Deke McClelland
Author

 
Expand all | Collapse all
  1. 1m 37s
    1. Welcome
      1m 37s
  2. 2h 27m
    1. The secrets of the dark interface
      3m 55s
    2. Background and Auto-Save
      3m 22s
    3. The altogether revamped Crop tool
      4m 0s
    4. The consolidated Properties panel
      3m 58s
    5. The searchable Layers panel
      5m 2s
    6. Modifying multiple layers at a time
      4m 50s
    7. The wide world of layer enhancements
      6m 48s
    8. Content-Aware Move and Extend
      6m 16s
    9. Content-Aware Patch
      3m 14s
    10. Auto-Power color adjustments
      6m 3s
    11. The brave new world of Camera Raw 7
      6m 16s
    12. The new three-part Blur Gallery
      8m 9s
    13. The Adaptive Wide-Angle filter
      7m 7s
    14. Correcting wide-angle panoramas
      7m 14s
    15. Text enhancements & styles
      4m 48s
    16. Filling & stroking shape layers
      4m 37s
    17. Aligning and stacking vector-based shapes
      4m 17s
    18. Working with the Scripted Patterns
      3m 32s
    19. Erodible brush tips & airbrushes
      5m 44s
    20. The enhanced Liquify filter
      4m 20s
    21. The new Oil Paint filter
      4m 10s
    22. Selecting skin tones and faces
      5m 11s
    23. The new Lighting Effects filter
      6m 29s
    24. Editing videos in the Timeline panel
      10m 16s
    25. Making editable 3D type
      8m 8s
    26. 3D shadows and reflections
      6m 35s
    27. Aligning and distributing meshes in 3D
      3m 0s
  3. 50m 34s
    1. Introducing the first Photoshop Creative Cloud update
      1m 36s
    2. Liquify and Blur Gallery support Smart Objects
      8m 42s
    3. Creating conditional actions
      9m 51s
    4. Moving a point with the Pen tool on the fly
      3m 32s
    5. Autonaming merged layers
      4m 42s
    6. Creating global default type styles
      4m 57s
    7. Copying CSS code from specialty layers
      4m 54s
    8. Enhanced 3D lighting with 32-bit bit color
      6m 42s
    9. The new default 3D image-based light
      5m 38s
  4. 29s
    1. Goodbye
      29s

Start learning today

Get unlimited access to all courses for just $25/month.

Become a member
Sometimes @lynda teaches me how to use a program and sometimes Lynda.com changes my life forever. @JosefShutter
@lynda lynda.com is an absolute life saver when it comes to learning todays software. Definitely recommend it! #higherlearning @Michael_Caraway
@lynda The best thing online! Your database of courses is great! To the mark and very helpful. Thanks! @ru22more
Got to create something yesterday I never thought I could do. #thanks @lynda @Ngventurella
I really do love @lynda as a learning platform. Never stop learning and developing, it’s probably our greatest gift as a species! @soundslikedavid
@lynda just subscribed to lynda.com all I can say its brilliant join now trust me @ButchSamurai
@lynda is an awesome resource. The membership is priceless if you take advantage of it. @diabetic_techie
One of the best decision I made this year. Buy a 1yr subscription to @lynda @cybercaptive
guys lynda.com (@lynda) is the best. So far I’ve learned Java, principles of OO programming, and now learning about MS project @lucasmitchell
Signed back up to @lynda dot com. I’ve missed it!! Proper geeking out right now! #timetolearn #geek @JayGodbold
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.


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 "Already a member? Log in

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 Photoshop CS6 New Features.

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

Your file was successfully uploaded.

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.