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

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

Using CSS Inspect

From: Dreamweaver CS6 Essential Training

Video: Using CSS Inspect

Live view is amazing at helping you understand how your layout will look in most browsers. But trying to troubleshoot your CSS can be frustrating. As the CSS visual aids that we covered in the last movie are disabled when you are in Live view. Well, that's where CSS Inspect comes in. CSS Inspect let's you do just that; inspect the elements on the page and visually explore the box model properties that have been set on the elements. As you'll see, it's an invaluable way to troubleshoot layout issues.

Using CSS Inspect

Live view is amazing at helping you understand how your layout will look in most browsers. But trying to troubleshoot your CSS can be frustrating. As the CSS visual aids that we covered in the last movie are disabled when you are in Live view. Well, that's where CSS Inspect comes in. CSS Inspect let's you do just that; inspect the elements on the page and visually explore the box model properties that have been set on the elements. As you'll see, it's an invaluable way to troubleshoot layout issues.

So I have the spotlight.htm file open and that can be found in the 06_10 folder. And I have Live view turned on. Now if I just scroll around my page you know everything looks for the most part okay, but I notice a couple of things right off the bat that are troubling. I have too much space between the headline and the student's name. And everywhere between the elements I have this sort of three pixel spacing that creates the look and feel borders around them, but towards the bottom here, I notice that the space between the footer and elements above it was actually probably about double that.

So I have some problems there that I need to track down. Now with a really complex layout like this one where you have a lot of elements on the page and lot of positioning going on, it can be very difficult to track that down, it can also be really difficult to sift through all the styles we have over here and find out what we are looking for. Now we learned a little bit earlier how to focus on an element and how to go to the CSS Styles panel and see what its properties are. That's one way to start troubleshooting something like this. But it's a little bit more helpful if you know exactly which elements are causing the problem.

So what I am going to do is I am going to come up to my document tool bar and I am going to turn on Inspect mode. Now the only time you are going to see that particular button, that Inspect button, is when Live view is on, when Live view is off it doesn't show up. So I am going to turn Live view on and then click Inspect. Now Dreamweaver is going to give you this little message that says Inspect mode is most useful with certain workspace settings. What it really wants you to do is have the CSS Styles panel open in one side and have the code open on the other, which is fine. It works fine, it works fine that way because you're able to kind of switch back and forth.

But I'm really more interested right now in getting a nice overview of the page so I am not going to turn that on. So as I mouse around I begin to see things you know I am not clicking on anything I am just mousing over elements, that's how you want to use Inspect. But I see overlays when I start mousing over elements. And I see these overlays I see different kind of colors show up. Well, what we are looking at is we are looking at the Box Model properties and that would be the Content, the Margins and the Padding. So let's say I mouse over this image of Gerald Chow. All I see is this translucent blue and sometimes it can look kind of green to depending upon what color of background you are over, that indicates content.

But if I mouse over student spotlight, I see this little yellow band down below, now the yellow indicates margins. And if I mouse up just so that I'm sort of in the parent elements the div with a class of students that's applied, I see all three. On the left hand side down here in the left corner, I see sort of that blue color which indicates content. I see on the far right hand side a yellow which indicates a really big margin which is pushing this over. And then on the top and on the interior right side of it I see sort of this magenta color and that's padding.

So I'm seeing all those elements. So, who is in charge of all the space between these guys? Well, if I hover over the name Gerald Chow I can see there's a fair amount of padding on top of that. If I hover over Student Spotlight I can see that there's a little bit of yellow margin below that and if kind of go back and forth between those two I can see that those are touching each other. So they are actually both responsible for all that space. I have a little bit of a margin below the Student Spotlight that actually looks pretty good, I probably don't want to get rid of that.

But this extra spacing that's caused by padding that's probably the culprit. Now, what if I scroll down and start going over elements on the bottom. Well if just over the image and just see the image if I come down a little bit, then I get a paragraph and if I go over to the left hand side, then I finally get this Container element and I can see that little margin that goes below it. But that margin that goes below it doesn't actually extend down in to the footer. So that tells me this is not the problem. And the one beside it is not the problem and the paragraph is not the problem.

Well, a lot of times, again when you're dealing with these complex structures it's really difficult to tell who is at fault or even which element might be causing the problem. So you end up mousing around a lot, trying to find out who it is and you know the footer is not it because I don't have any margin above the footer. So let me show you a really neat way to deal with nested elements when you're using CSS Inspect. Now I want to make a point of saying this because I'm betting that a few of you that are watching this exercise with me and doing it along with me, have sort of disabled CSS Inspect sort of unwittingly.

If you ever click on an element, essentially what Dreamweaver does is it establishes focus on that element and it turns Inspect off. So as I begin to hover around anymore, I'm not seeing it any more. If that happens to you, don't panic it's not a big deal. All you have to do is get right back up to Inspect, turn it back on again and you're back in business. So if I hover over a nested element like this photograph for example, I am seeing the contents of the photographs. But I can also start using my Arrow keys. If I hit my left Arrow key I go back outward to the parent that it sits inside of, in this case it's a div with class of artwork and I can use my Tag Selector to see that.

If I hit my left Arrow one more time it goes further up the tree to its parent. Now look, see this is the article with an ideal spotlight and sort of everything sitting inside of it I can see that it has a margin that's pushing down a little bit and it's actually touching the footer. And if you hit your right Arrow key you'll go back down the tree. If I had to guess out of these elements, I would say that last one is causing the problem. So now by using CSS Inspect, we get a nice visual overview of all the Box Model properties the elements have applied to them.

And it's really easy for us to troubleshoot and find out who is causing issues within our layout. So now that we know the elements that are causing the problems, correcting them will actually be pretty easy. Now I know that often it seems like people kind of hype features, they hype it more than maybe it deserves. But I am being incredibly honest with you here when I say that I view the CSS Inspect feature as an invaluable part of my style and workflow. If you've ever used Firebug, Opera's Dragonfly or Webkit Inspector you know they have a similar feature to CSS Inspect.

However, when Dreamweaver's CSS Inspect is combined with another feature which is the Code Navigator they become an indispensable tool for inspecting and troubleshooting your styles. So in the next movie, I am going to show you the Code Navigator and how it works with CSS Inspect.

Show transcript

This video is part of

Image for Dreamweaver CS6 Essential Training
Dreamweaver CS6 Essential Training

90 video lessons · 52961 viewers

James Williamson
Author

 
Expand all | Collapse all
  1. 1m 4s
    1. What is Dreamweaver?
      1m 4s
  2. 5m 44s
    1. Welcome
      1m 4s
    2. Using the exercise files
      2m 17s
    3. Learning web design
      2m 23s
  3. 1h 0m
    1. Looking at the Welcome screen
      5m 9s
    2. Exploring Windows and Mac interface differences
      5m 6s
    3. Arranging panels
      8m 44s
    4. Managing workspaces
      10m 14s
    5. Exploring the Application toolbar
      6m 21s
    6. Exploring the Document toolbar
      8m 47s
    7. Working with the Property inspector
      9m 30s
    8. Using the Insert panel
      6m 30s
  4. 53m 3s
    1. Understanding basic site structure
      3m 46s
    2. Exploring file naming conventions
      2m 10s
    3. Defining a new site
      5m 23s
    4. Managing files and folders
      7m 57s
    5. Adding remote servers
      7m 4s
    6. Uploading files
      12m 46s
    7. Previewing in browsers
      9m 11s
    8. Managing multiple sites
      4m 46s
  5. 36m 41s
    1. Creating new documents
      6m 49s
    2. Setting up new document preferences
      5m 30s
    3. Setting accessibility preferences
      6m 49s
    4. Working with starter pages
      4m 32s
    5. Managing starter pages
      13m 1s
  6. 37m 23s
    1. Getting text into Dreamweaver
      8m 43s
    2. Importing Word documents
      4m 6s
    3. Adding structure to text
      7m 35s
    4. Creating lists
      4m 35s
    5. Creating definition lists
      4m 0s
    6. Using the Quick Tag Editor
      8m 24s
  7. 44m 41s
    1. Exploring the Code toolbar
      5m 41s
    2. Setting code preferences
      7m 19s
    3. Using code hints
      8m 8s
    4. Wrapping tags
      5m 7s
    5. Adding comments
      6m 29s
    6. Using snippets
      7m 32s
    7. Formatting source code
      4m 25s
  8. 1h 19m
    1. Setting CSS preferences
      9m 32s
    2. An overview of the CSS Styles panel
      9m 23s
    3. Creating a new CSS rule
      6m 42s
    4. Using the CSS Rule Definition dialog
      7m 25s
    5. Organizing styles
      7m 22s
    6. Modifying style properties
      6m 17s
    7. Controlling CSS through the Property inspector
      6m 37s
    8. Attaching external style sheets
      5m 54s
    9. Using CSS visual aids
      7m 3s
    10. Using CSS Inspect
      6m 48s
    11. Using the Code Navigator
      6m 39s
  9. 1h 11m
    1. Managing assets in Dreamweaver
      7m 30s
    2. Setting external image editing preferences
      4m 26s
    3. Placing images on the page
      10m 12s
    4. Exploring Photoshop integration
      7m 17s
    5. Modifying Smart Objects
      9m 42s
    6. Modifying image properties
      8m 4s
    7. Styling images with CSS
      6m 45s
    8. Using background graphics
      7m 28s
    9. Positioning background graphics
      10m 10s
  10. 36m 23s
    1. Link basics
      3m 17s
    2. Setting site linking preferences
      2m 19s
    3. Creating links in Dreamweaver
      9m 17s
    4. Using absolute links
      3m 43s
    5. Using named anchors
      6m 41s
    6. Creating an email link
      5m 25s
    7. Creating CSS-based rollovers
      5m 41s
  11. 44m 30s
    1. Reviewing table structure
      5m 20s
    2. Importing tabular data
      6m 46s
    3. Creating accessible tables
      6m 11s
    4. Exploring basic table styling
      9m 42s
    5. Styling alternate rows
      8m 57s
    6. Creating custom table borders
      7m 34s
  12. 59m 15s
    1. Understanding how forms work
      2m 45s
    2. Reviewing form design
      3m 44s
    3. Creating accessible forms
      5m 16s
    4. Setting form properties
      2m 39s
    5. Using the fieldset and legend tags
      2m 52s
    6. Inserting text fields
      6m 56s
    7. Inserting list menu items
      7m 54s
    8. Inserting checkboxes
      4m 14s
    9. Inserting radio button groups
      3m 52s
    10. Inserting submit buttons
      2m 25s
    11. Exploring basic form styling
      8m 2s
    12. Exploring form element styling
      8m 36s
  13. 33m 25s
    1. Adding CSS3 transitions
      8m 29s
    2. Spry overview
      2m 44s
    3. Using Spry widgets
      3m 57s
    4. Adding Spry effects
      8m 1s
    5. Using the Widget Browser
      7m 4s
    6. Extending Dreamweaver
      3m 10s
  14. 1m 2s
    1. Additional resources
      1m 2s

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

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.