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

Styling Spry tabs

From: Layouts with CSS in Dreamweaver

Video: Styling Spry tabs

In the previous movie, we added the Spry Tabbed panels to the page and realized that they were existing CSS rules for which we'd have to find a fix. And now I'll show you a strategy for discovering what those are. To do this, let's go into Current mode and I want to use one of Dreamweaver's really powerful tools in conjunction with Live View, and that's Inspect mode. So if I click on the Inspect here, when I hover over any of the various elements, if I'm in Current mode, I'll be able to see exactly what's going on with the existing rules.

Styling Spry tabs

In the previous movie, we added the Spry Tabbed panels to the page and realized that they were existing CSS rules for which we'd have to find a fix. And now I'll show you a strategy for discovering what those are. To do this, let's go into Current mode and I want to use one of Dreamweaver's really powerful tools in conjunction with Live View, and that's Inspect mode. So if I click on the Inspect here, when I hover over any of the various elements, if I'm in Current mode, I'll be able to see exactly what's going on with the existing rules.

And I can see that here I have one rule for the mainContent li or list item that is giving me an additional margin-bottom of 0.75em and we can test to see if that is the issue by disabling the CSS property temporarily. And in fact, that's it, so that's one of the two things that we'll need to change. And I notice up here that there is the parent of the li which is the ul, and that very likely is causing my tabbed panels' labels to move over to the right because Spry uses the unordered list to create those, so let's check that out.

And here I see in fact that there is additional margin and padding being added. So if I remove the padding, that shifts it over a little bit, and if I remove the margin, that shifts it over all the way. So that's really what they should look like just from a default perspective. Now you don't of course want to go in and just disable existing properties willy-nilly. You want to go in and replace them and target them in such a way that the rules that you're replacing them with have at least the same specificity as those that are existing and impacting on your page.

So I'm going to go back to Inspect mode and then just find this first rule here. I'll click once to move out of Inspect mode, but that also locks down the CSS STYLES panel. So now let's go locate that code and I'll do that by right-clicking on the rule and then choosing Go to Code. So here are both my disabled ul and li; let's re-enable those. And I'll just click into the rule and then go over to the CSS STYLES panel and re-enable it.

Now let's do the same thing here for the ul, clicking into that ul rule, not into the disabled part because Dreamweaver can't see that but into the start of the curly brace there or just after the curly brace, and then let's re-enable those. So what we're going to do is take both of these rules, I'm going to copy them, and then paste them down and add some specific selectors, so that we can target our tabbed panels and add in the properties that we want. Command+C to copy; Ctrl+C of course on the PC, and I'll just place them right here with a Command+V; Ctrl+V.

So now, we want to target our tabbed panels and the class to do that with is called the TabbedpanelsTabGroup. So let's put in the TabbedpanelsTabGroup and I'm going to copy this ul selector here, and then paste that in front of the li and add one more space. Let me go ahead and make the changes, and then I'll show you how I came up with the TabbedpanelsTabGroup class.

Let's go ahead and set the margin and padding in the ul.TabbedpanelsTabGroup, both to 0. And for the list item in that targeted unordered list, I'm going to keep the font-size at 1em. That wasn't the problem; margin-bottom was definitely an issue, so let's change that to 0. And for the time being, let's also keep the color. I promised to show you how I came up with that concept, and the way that it's done is you use Live Code in conjunction with Live View in order to see what classes are being dynamically added by the Spry framework.

So I'm going to move over my Code window a little bit here, as soon as I can locate the selector, I'm not being cooperative, there it is, and let's go over to our tabs. And now as I scroll over of them, let me just click on one so that we can get to that exact area. Here, you can see over on the left in Live Code is that I'm actually in the Content area for the Tabbedpanels group. And if I scroll up a little bit, I can see that the ul has the class of TabbedpanelsTabGroup.

And that's the same name that I used in setting up my CSS, right there. So that's one good change and things are looking a little bit better. At this stage, we're ready to bring in the content now and start consolidating that. That'll take just a little bit of cut and paste. So I'm going to drop out of Live View and let's go back over to our first tab which is a Backpack.

And once I have selected that, and as I mentioned earlier, you move from one tab content area to another, by clicking on the Eye icon, so make sure that you are in the Content 1 or the first tab area. And now I want to select this tour description here, so I'll put my cursor right after the first heading and then click div.tourDescription from the tag selector, cut it with a Command+X; Ctrl+X on the PC. Dreamweaver has an unfortunate habit of scrolling back to the top when you remove some content from the middle of the page, so I have to scroll back down.

Now let's select Content 1 and then replace it with a Command+V; Ctrl+V, for pasting. Scroll back down, and there is our tour description under Backpack one. All right! Let's continue, move to Calm which is Content 2. And because the first tour description has now been cut, the second one shows up immediately underneath; very handy. So select div.tourDescription, cut it, and then replace the placeholder line Content 2 with a Command+V; Ctrl+V, paste.

Okay, ready to move to number three. Put your cursor right after California Hotsprings, select div.tourDescriptions, cut it, and then replace Content 3 with a paste. Final one, for Cycle. Move into the tourDescription div, select it all from the tag selector, cut it, and this time because there is no content below that, Dreamweaver does not go up.

A small blessing, thank you, and now we paste in Content 4. Okay, let's take a look at it in Live View and see how we're doing. So everything is looking pretty good; all of my content is in the right place. Wherever there's an element that was previously placed in the tour description that we no longer need and that's this top border that we see here, we already have enough separation with the tabs and this is no longer necessary. So I'm going to go ahead and just use Inspect one more time, and locate that border by hovering my cursor over the content area and then using the Left Arrow to move up the DOM and find exactly where it's defined.

And it only takes one press and we can see the border-top property being added to mainContent div.tourDescription. So I will click once to lock that in, and in this situation, there's no need to write another rule because this selector is targeted enough, it's not being used elsewhere. So I can just select border-top and then press Delete CSS Property. In the next movie, we'll customize the CSS for the Spry Tabbed panels.

Show transcript

This video is part of

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

30 video lessons · 21398 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.