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

Using the CSS Rule Definition dialog

From: Dreamweaver CS6 Essential Training

Video: Using the CSS Rule Definition dialog

Once you've created a rule visually within the CSS Styles panel, you're then presented with the CSS Rule Definition dialog box. Using this dialog, you'll enter the values for properties that you wish to set. We're going to finish the Info section's headline rule by setting the appropriate property. So I'm really just picking this up right from where we left off in the last movie. I've created a new rule. It's a compound selector, section.info h2, which is going to target any heading 2, inside of a section element with a class of info applied, so a fairly specific rule.

Using the CSS Rule Definition dialog

Once you've created a rule visually within the CSS Styles panel, you're then presented with the CSS Rule Definition dialog box. Using this dialog, you'll enter the values for properties that you wish to set. We're going to finish the Info section's headline rule by setting the appropriate property. So I'm really just picking this up right from where we left off in the last movie. I've created a new rule. It's a compound selector, section.info h2, which is going to target any heading 2, inside of a section element with a class of info applied, so a fairly specific rule.

And that is going to be contained within the main.css. So once you've entered everything into the New CSS Rule dialog, you click OK and that's when this one comes up. This is the CSS Rule Definition dialog box. Now I know a lot of you guys out there probably prefer to hand-code your styles and there's nothing wrong with that whatsoever. But for those of you that are new to CSS or for those of you that are just looking to do something very quickly visually without having to switch over to the code, this dialog box makes a lot of sense. You'll notice that we have a list of categories over here on the left-hand side.

Those categories basically group properties together based on what they control. So the first one that we're presented with is Type and of course, we see over here on the right-hand side, all of the properties that we can set for an element in terms of its type. So one of the first things I want to do is I want to set the Font-family for this. Now I notice that this is a pulldown menu and if I click on that pulldown, I see a list of sort of default font stacks within Dreamweaver. Now if you're not familiar with what a font stack is, essentially the first font that is listed here is the font that the page is going to request from the client machine.

If that font is not found, it moves on to the next one and finally falls back to a default sort of generic family if you will, and it just says to the computer, okay, fine, just give me whatever sans serif you typically use. So it's a way of sort of protecting ourselves, in case that particular machine doesn't have a font installed. Now the issue with what we're doing here though is that we're using Web fonts. Web fonts basically allow you to use nonstandard fonts, fonts that don't have to be installed on a client machine. In this case we're going to be hosting them ourselves. So here I need to define a font stack that isn't already here inside Dreamweaver.

Well, the nice thing is I'm free to just type whatever font stack I want in. What I'm going to do is I'm just going to click right here for Font-family. I'm going to type in the word Bitter with a capital B, Georgia, Times, serif. Now as you can imagine, if you have to do that every single time you declare a font inside this dialog box, that's going to get pretty tedious. Well, one of the really nice things that we have here in CS6 is we have this little icon over here that says Add Font to Favorites and when I do that, as soon as I click that, that's going to place the stack that we just wrote within that pulldown menu.

So now every single time, and it doesn't matter whether it's this file or a file ten weeks from now, when I come back into Dreamweaver, that's going to be available to me in my font stack, which is excellent. I love that feature, and I'm really happy to see that. The next thing we're going to do is we're going to define the size of the font. Now for this font, we want the font to be 1.6ems. Now I'm free to go ahead and grab ems from this pulldown menu of units of measurement, but if you're in a hurry and you like doing things quickly, you can just do this. You can type in 1.6, no space, just type an em and hit Tab, and it's just going to tab it over.

Now be very careful when you're entering in values in this dialog box, not to hit Enter or Return, because if you do, it's likely going to go ahead and close this dialog box thinking that you're just saying, okay, you're finished with the rules. So be very careful about that. Tab is your friend here. Don't hit an Enter or a Return. Tab from one value to the next, if you continue to want to move around. Now for Line-height I'm going to grab Line-height, and move it 45px, again, I'm just going to do px right beside it. That's going to ensure that we have pixels there. And so that's all I need for my fonts. The rest of these properties I'm just not going to set.

The next thing I'm going to do is go to Background. I want these guys to have a background image behind them. Again, it's one of the really nice things about this particular dialog box. I can click on the Category and I can see kind of all of the things that are available to me, Background-color, image, whether that background image should repeat, all sorts of things. So this is really easy to work with. I'm just going to browse out and what I want to do is I want to go in the 06_03 folder because that's the one we're working with right now. I want to open up the images directory, and inside images, what I want is I'm looking for this one right here, diag_pattern.png; that's the one I want.

I'm going to click OK and then I do want that to repeat, so I'm not going to select anything on Background-repeat. The default is for it to repeat, so I don't need to actually explicitly ask for that. Finally, the last thing I'm going to do is I'm going to come over here into the Box category and in the Box category I'm going to turn Padding, which is the interior space of an element. I'm going to turn off Same for all and I'm going to do a Padding Left of .6ems, so it's going to push the edge of the text away from the edge of the Info box.

Now if you ever want to sort of preview what the style is going to look like, you can always click Apply before you click OK. As soon as I click Apply, you're going to get a nice sort of preview of what this is going to look like. Now because I don't have Live view turned on, it's not 100% exactly what it's going to look like, but it's very, very close. Now I noticed something right off the bat by doing this, I forgot to do color. So that's one of the things I like about that Apply button is when you click on that, you can sort of say, is that the way I want it to look? No, it's not. Okay, let's go fix something. So I can go right back up to the Type Category and that's where I'd find Color and I'm just going to type in the word white and hit tab and now when I hit Apply again, I can see that my headlines are white, so that's perfect.

So now I know it's exactly the way I want it and I can click OK. Now if you ever do close out of that dialog box by mistake, don't worry. You can come right back over to the CSS Styles panel, you can find the rule that you just created and double-clicking it should bring that Info box right back up again. So you can just pick up where you left off. Now I do want to point out something that carries over from the previous movie. You'll notice that if we look in our CSS Styles, this rule that we just created, section.info h2, notice its location. It's just below section.info.

The reason that it's located there is because I had clicked right on this and focused on that rule before I created a new one. So if you're focused on a rule within a style sheet, and you create a new CSS rule using this icon, it's going to place it just below the rule that you were focused on. Now if you don't see yours there, and it ended up towards the bottom of your styles, don't panic. I'm going to show you guys how to organize your styles and move them around within your CSS Styles panel, so that you don't have to resort to going ahead and doing that by hand. Now I feel like I need to point out, there are a lot of other options for creating CSS rules in Dreamweaver.

And in fact, we're going to explore exactly how to create rules via the Properties Inspector a little bit later on in this chapter. However, the ability to go ahead and create these rules visually is a very powerful option in Dreamweaver, especially for those of you that are new to CSS and maybe you're not fully comfortable yet with all the properties that are available to you when you're creating rules. I do feel like I need to point out however that this dialog box isn't appropriate for all instances, as there are properties that aren't available as options that exist within CSS, so not everything is contained within that dialog box.

For those instances, the CSS will need to be created by hand, which is really just yet another reason for making sure you become comfortable with CSS syntax.

Show transcript

This video is part of

Image for Dreamweaver CS6 Essential Training
Dreamweaver CS6 Essential Training

90 video lessons · 53687 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
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 Dreamweaver CS6 Essential Training.

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.