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

Exploring CSS3 enhancements

From: Site Navigation with CSS in Dreamweaver

Video: Exploring CSS3 enhancements

While the ability to incorporate background images in navigation gives web designers a great deal of flexibility, it's also a tad annoying. Any changes mean breaking out your graphics program, finding the source file, and crafting the updates, and then exporting the images and testing. Wouldn't it be great if you could just create tab navigation with rounded corners and complex gradients all in Dreamweaver? Well, with CSS3 you can. In this video, I am going to create the tab navigation we built using the Sliding Door technique in the Chapter 03 video "Setting up adjustable backgrounds" that you can see here.

Exploring CSS3 enhancements

While the ability to incorporate background images in navigation gives web designers a great deal of flexibility, it's also a tad annoying. Any changes mean breaking out your graphics program, finding the source file, and crafting the updates, and then exporting the images and testing. Wouldn't it be great if you could just create tab navigation with rounded corners and complex gradients all in Dreamweaver? Well, with CSS3 you can. In this video, I am going to create the tab navigation we built using the Sliding Door technique in the Chapter 03 video "Setting up adjustable backgrounds" that you can see here.

We'll start with the css3nav.htm file. Now, I have all the basics in place, so we can just concentrate on the CSS3 enhancements. Notice that I have hovers happening, and my background colors changing. Pretty simple. So let's go to Split view and I am going to go up to the anchor tag here, which is nav li anchor (a) and I am going to add a couple of rules. Now the nice things about this with Dreamweaver is it has full code hint support. So if I type in -webkit, you can see that that first comes up, and if I hit webkit, I get a full list of all the webkit browser-specific properties.

So the one we are looking for is border and we actually want the top-right so let me scroll down to here, border- top-right-radius, and we want to set that to eight pixels. This is going to give our top-right corner a rounded radius of eight pixels, and we want to do the same thing for the top-left, so I am going to do -webkit and then hit return and just start typing border and locating the top-left radius and also making that eight pixels. Now, not only does it support the Safari webkit rendering engine, but Dreamweaver also has support for Mozilla, which creates of course the Firefox browsers.

So it's -moz and the syntax here is border-radius topright and topleft. We of course want these to match, so I am going to go ahead and make those eight pixels and then do the one for the other border radius, which is topright, also making that eight pixels. Now I mention that this is a CSS3 property, so it is in the spec. And if all browsers get around to supporting it, we want to make sure that we already have that built in so we're not just targeting Safari and Firefox browsers.

So we'll put in the generic, if you will, CSS3 properties, which is border-top-right-radius, and there is the code hint support for that. And of course we are going to make that eight pixels, and we also want to do the same thing for the topleft. Okay, so if we go over to Live view here--I am going to just shrink down so you can see everything--notice we have very nicely rounded corners there, without any images. And now we are also ready to address the gradients without using an actual background image--although we do need to employ the background image property.

So I am going to go to Full Code view because the syntax for the background image gradient is kind of lengthy. But this also goes to the anchor tag and after all of our properties that we used to create the rounded corners, we'll put in a background image property to start. And then for a value, we'll start by putting in a webkit-specific value, and unfortunately there is no code hint support here, so you'll have to put in webkit-gradiant, and this is followed by a set of parentheses. Within the parentheses, we say what type of gradient it is, and this is going to be a linear gradient. And where does it start? It starts at the left top, comma, and it goes to the left bottom, comma.

Now, what's the color range? Well, it goes from, the keyword, and then in parentheses, whatever you're starting with, and in this case we're starting with the white. Close the parentheses comma, to, and then whatever the final element is, and in this case it is a hexadecimal value of e4e4e4. I need one more parentheses to complete this and then a semicolon. Now, that will handle the gradients for webkit. There is a different syntax for Mozilla, but it also uses the background image property.

So we start with a -moz and the type is actually put in the name of the property here, so it is linear-gradient and we have a parentheses set. Now instead of doing directions left top, left bottom, Mozilla actually works by degrees. So in order to get a linear gradient you put in -90 degrees, or deg, followed by the two colors the top color, which is going to be #fff, and the bottom color, which again will be #e4e4e4.

So now let's close that out with a semicolon, and let's head back to Design view and see how we are doing. Well, you can see the gradient is already in place, and when I hover over it, I go back to the solid color, so I am going to have to add another rule to handle that gradient, but it looks pretty good. We are going right from white to this light tan and pretty effective I think. So let's go back to code and will add in one more rule to make sure that we take care of the hover state.

So you'll notice right below our pretty lengthy nav li a selector is the nav li a hover selector, and that's exactly where will need to put in the code for the gradients, so we can get a reverse gradient here. And I am going to go ahead and just copy this, because it's the same syntax it's just different values, and paste that in. Now, I am just going to reverse the two colors. So instead of fff here, I'll make this e4e4e4 and we'll switch this to fff, and then we'll do the same thing for Mozilla.

In this case, I'll just cut that and then paste it in. All right, so let's take a look at it in Live view, and now you can see that the background gradient switches on hover as well. Now, the cool thing is that these navigation buttons are just as flexible as those built with the Sliding Door technique. So if I go to Split view, and let's click on products here and make that Products and Services, and again we'll change services to the Contact Page and just go strictly to Design view, you can see that the button stretches the way that we would hope it had.

Now granted this CSS3 functionality is restricted to just the latest Firefox and Safari browsers, but if you need to, you can replicate it with an Internet Explorer gradient filter. I think this peek into some of the CSS3 features is quite instructive in terms of what's coming in the near future. I hope you agree.

Show transcript

This video is part of

Image for Site Navigation with CSS in Dreamweaver
Site Navigation with CSS in Dreamweaver

40 video lessons · 18161 viewers

Joseph Lowery
Author

 
Expand all | Collapse all
  1. 2m 20s
    1. Welcome
      1m 2s
    2. Using the exercise files
      1m 18s
  2. 9m 26s
    1. Using icons in navigation
      2m 14s
    2. Understanding 3D nav bars
      2m 25s
    3. Understanding explanatory navigation
      1m 51s
    4. Creating animated navigation
      2m 56s
  3. 1h 14m
    1. Inserting Spry horizontal menus
      7m 4s
    2. Styling Spry menus
      6m 29s
    3. Adding Spry vertical menus
      5m 7s
    4. Styling Spry vertical menus
      10m 53s
    5. Using Spry tabbed navigation
      9m 33s
    6. Styling Spry tabbed menus
      9m 55s
    7. Including Spry accordion panel menus
      5m 32s
    8. Styling Spry accordion menus
      11m 10s
    9. Advanced Spry menu techniques
      8m 32s
  4. 35m 45s
    1. Converting lists to menus
      7m 56s
    2. Working with background images
      5m 47s
    3. Implementing sprites
      5m 53s
    4. Setting up adjustable backgrounds
      9m 4s
    5. Designing accessible navigation
      7m 5s
  5. 30m 34s
    1. Looking at the project
      1m 4s
    2. Building up the basic HTML
      2m 9s
    3. Displaying top-level links horizontally
      8m 12s
    4. Customizing the link states
      4m 29s
    5. Adding drop-down menus (HTML)
      3m 48s
    6. Working with submenus (CSS)
      4m 8s
    7. Achieving interactive submenus
      2m 21s
    8. Marking the current page
      4m 23s
  6. 23m 13s
    1. Looking at the project
      57s
    2. Understanding vertical menus
      2m 15s
    3. Defining width for link elements
      4m 43s
    4. Using background graphics with navigation
      5m 45s
    5. Creating pop-out vertical navigation
      6m 29s
    6. Setting link states
      3m 4s
  7. 10m 13s
    1. Identifying anchor tags
      7m 4s
    2. Identifying external links
      3m 9s
  8. 18m 14s
    1. Creating jQuery animated image menus
      7m 45s
    2. Using the HTML5 nav tag
      3m 24s
    3. Exploring CSS3 enhancements
      7m 5s
  9. 28s
    1. Next steps
      28s

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 Site Navigation with CSS in Dreamweaver.

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.