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

Fine-tuning Spry tabs

From: Layouts with CSS in Dreamweaver

Video: Fine-tuning Spry tabs

Now we are ready to fine tune this bright tabbed panel CSS. I will say that right now it actually doesn't look bad in terms of the basic colors, but I think I want to do some things to really make this standout. And the first thing I want to do is add in some rounded corners for our tabs. So let's go ahead and switch over to the All mode, and as I've mentioned in other videos, I do find it often a lot easier to work in All mode with the Spry CSS files, because they are so logically laid out.

Fine-tuning Spry tabs

Now we are ready to fine tune this bright tabbed panel CSS. I will say that right now it actually doesn't look bad in terms of the basic colors, but I think I want to do some things to really make this standout. And the first thing I want to do is add in some rounded corners for our tabs. So let's go ahead and switch over to the All mode, and as I've mentioned in other videos, I do find it often a lot easier to work in All mode with the Spry CSS files, because they are so logically laid out.

So the first thing we want to change is TabbedpanelsTab. Now I am going to right-click and Go to Code. So I can address this. As you can see, let me switch to Code View, so you can see it all directly. If you lose it in Code View, if you just press your arrow keys left or right, Dreamweaver will reposition the window, so you can find it again. So there are quite a few properties here, but let's go ahead and add in some new ones right at the bottom. I will put my cursor right after the last one, and hit Return or Enter.

Now, first, I am going to put in the vendor specific rules. Instead of changing the entire border-radius, which I would do if this were an isolated Box, I want to change just the Top Right and the Top Left. Now there are different syntaxes for both the Mozilla and WebKit Browsers, so we'll need to use Dreamweaver's Code Hints to find the right ones. So let's start off with Mozilla, and put in the hyphen to get vendor specific preferences and there you see Mozilla. I will just hit Return now. Now, I do know that it's a border related one, so I am just going to go ahead and put border and then another hyphen.

Now I see the radius down below here, but it looks like there are other ones available to me. And there are in fact, individual ones for each corner. So I will go down to border-radius, Top Left. And press Return or Enter. And I want to set this to a value of 8 pixels. So again, we have to put in one for the Top Right. So I will type in moz-and border, and then I will just scroll down, select it here, and then press Return or Enter.

Save myself and you a little typing. So those are the first two. Now we need to switch over to WebKit. So hypen and a w, and that will give us the WebKit preference. Press Return. Now if you type in border, you'll start to see all of the various options there. And I can see that I have two that I want; that instead of border-radius Top Right, as it is in Mozilla, here it's border Top Right radius. So select that. Press Return and same value.

Again, we will bring in WebKit, type border, and then select the final one, which is border-top-left-radius. Same radius. Now to future proof our rounded corners, let's go ahead and put in the CSS 3 property, which Dreamweaver also supports in code hints and that's just border, and as I can see there's a border-bottom, I bet there is a border top, and there it is, border-top-left-radius. So it actually follows the WebKit syntax and we will that at 8 pixels and here's the final one, border-top-right-radius.

Okay, so I am going to go ahead and save this for right now. That was a lot of work, and let's go back over to Design View and because we are in Life View now, you should see your rounded corners. All right, looking pretty good. Next, I want to change the hover color to make a little bit more specific for what I need to modify and you can see that the next state here in the list is TabbedpanelsTabbedHover. Right now, it's kind of a dark gray, that's fine, but let's modify it and sample the dark blue that we see here on the right.

So I will click on the Color Swatch and then choose my blue color from the top there. So now when I go over and select, I am getting a dark background, but it's making it a little bit hard to read the labels. So we are going to need to modify and change the color. Now the first thing you might want to try is to go ahead and add in a Color property of white, so let's give that a shot. First thing I want to do is actually show only the set properties here. We have been showing all the properties in the List View. But because I want to get to my Add Property option, I am going to choose Show only set properties.

And now I can click on Add Property and let's put in a color and let's make that color white. Okay, let's give that a shot. Well, no change. So obviously there is something else that's preventing my white color from taking effect. So let' go ahead and remove our white color, since that doesn't have the effect that we want, so I will delete that. And now let's go back into Inspect mode in order to try to identify it. So I want to go to Current mode here, to use it in conjunction with Inspect mode.

So I will click on Inspect mode and then hover over the tabs and I see the color that is coming in that's set for this main color, but it doesn't really affect the hover state, and if I look at hover, that's the same CSS rule that we just tried to apply. So what we are going to need to do is to create a new rule that includes the hover state in Spry, and change to that color. So let's go over to where that color was set and I am going to use the Go to Code option here, and press my arrow key in order to locate that in Dreamweaver.

So here is that rule that we need to amend to add a hover state. So let's just copy that entire thing, and then I will paste it. And the class that we add here also discovered by using Live View is TabbedpanelsTabHover, and we only want to affect the color here, so I will remove those other two rules, and I am just going to put in FFF for white.

Okay, now let's take a look. Well, that seems to work, but look what happens when you roll over a selected state? This often can happen when you're making modifications to your CSS rules, is that one change might cascade and cause a problem in another rule. So we want to keep this, but fix this. So to do that, we are going to create one more rule, so I am going to select that rule, copy it and then place my cursor after it and paste it in, and I am going to add one more class after TabbedpanelsTabHover, and that is, .TabbedpanelsTabSelected.

When you take a look at the Live Code, you will see that it's Spry often puts in multiple classes and we can use that multiple classes to really target our selection. So now what I want to do with this rule, is I want to instead of making it white, let's find that blue color again, and sample that. And you will find that all the way up at the top there, and if I select in my CSS Styles over here, I can cause the CSS Styles panel in current mode to show that particular property, Click the Color Swatch and then sample the blue.

Okay, so let's take a look at that in Live View, and I will scroll down to where my tabs are and now when I scroll over the unselected state, I get exactly what I was looking for, and if I go to the selected state, I get a nice blue instead of the white. Now whether you keep these rules that we created that have Spry classes in them in the main.css, or you move them to SpryTabpanels.css, is a choice, it's up to you.

I tend to keep some in the same location, but that's up to you. Often when you are incorporating tabbed panels into a page, you will have to make adjustments to the existing content, as well as modifying the panel CSS to fully integrate them into your site, as we did in this video.

Show transcript

This video is part of

Image for Layouts with CSS in Dreamweaver
Layouts with CSS in Dreamweaver

30 video lessons · 21423 viewers

Joseph Lowery
Author

 

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 Layouts 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.