Start learning with our library of video tutorials taught by experts. Get started

Create a Sliding Tabbed Panel with jQuery and Dreamweaver
Watching:

Adding CSS styles to the text


From:

Create a Sliding Tabbed Panel with jQuery and Dreamweaver

with Chris Converse

Video: Adding CSS styles to the text

Now we want to create some CSS rules to style the text inside of the panels. Now, we're going to be using compound rules, which means we want to target only the text that's inside these panels. And Dreamweaver gives us a nice little shortcut to help us write a compound rule. So if have my cursor inside of one of the panels--and I can see on the document tree here that I'm inside of the paragraph tag, inside of panel_content--and we can see this follows all way up to to the div.sp, which is the overall container for our sliding panel. With my cursor inside of here, I come over to this CSS styles property, click on Create New Style, and when we select Compound from the type of list, notice that Dreamweaver will write a compound rule targeting exactly the element I had selected, all the way from the highest-most parent, which in this case is the sp tag.

Watch this entire course now—plus get access to every course in the library. Each course includes high-quality videos taught by expert instructors.

Become a member
Please wait...
Create a Sliding Tabbed Panel with jQuery and Dreamweaver
1h 6m Intermediate Oct 11, 2012

Viewers: in countries Watching now:

A tabbed panel interface is a classic feature to incorporate in your website design, but they're usually static elements. This course shows how to build a dynamic sliding tabbed panel from scratch using a combination of HTML, CSS, jQuery, and the tools in Dreamweaver. Author Chris Converse leads you through the process from start to finish, from building the containers to styling the text, tab, and panels, and adding click events to make the tabs interactive. He also shows how to incorporate progressive enhancement techniques, so visitors who don't have JavaScript, for example, can still access the content.

Topics include:
  • Creating the main panel and tab containers
  • Adding content to the containers
  • Adding CSS styles to the text and tabs
  • Adding the jQuery $(document).ready() function
  • Assigning click events to the tabs
  • Setting an autostart on page load
  • Creating custom graphics for the panels
  • Assigning custom classes to the HTML elements
  • Reassigning CSS rules with JavaScript
Subjects:
Developer Web Web Design Projects Web Development
Software:
Dreamweaver jQuery
Author:
Chris Converse

Adding CSS styles to the text

Now we want to create some CSS rules to style the text inside of the panels. Now, we're going to be using compound rules, which means we want to target only the text that's inside these panels. And Dreamweaver gives us a nice little shortcut to help us write a compound rule. So if have my cursor inside of one of the panels--and I can see on the document tree here that I'm inside of the paragraph tag, inside of panel_content--and we can see this follows all way up to to the div.sp, which is the overall container for our sliding panel. With my cursor inside of here, I come over to this CSS styles property, click on Create New Style, and when we select Compound from the type of list, notice that Dreamweaver will write a compound rule targeting exactly the element I had selected, all the way from the highest-most parent, which in this case is the sp tag.

Now we don't need this to be quite as specific, so let's come in here and let's remove all of the intermediate rules. And we're just going to have .sp--the outermost container--space p. So we want to target the paragraph tags inside of the outermost container for our sliding panel. Next, let's come down here and make sure that we have the sliding_panels.css chosen so that when we write CSS rules here, even though we're in the index.html file, those rules will go into the sliding_panels.css file. Let's click OK. Now for paragraph we're going to come in here to Font-size.

We're going to specify 1 em. And over at the Box properties, let's come in here, and let's uncheck Margin Same for all, and let's add a 0 on the Top, 0 on the Right, we're going to add 1 em on the Bottom, and then 0 on the Left. Now, when I click Apply we can see some slight changes over in the left-hand side here. We can see that we now have these individual paragraphs have no margin at the top. Let's click OK. Let's create one more rule. We want this to be for an h2.

So I'll select a couple of characters in the heading. Come over here, create a new CSS rule, Compound. Let's get rid of all of the intermediate classes, so we have .sp h2. Click OK. What we're going do here for Font-size, we are going to type 1.15 ems; this will give us a 15% increase on the base font size. Box properties, uncheck Same for all from Margin. We're going to type 0 on the Top, 0 on the Right, .5 ems on the Bottom. and 0 on the left, and then click Apply.

Once we do that, you'll see all of the h2 tags now stick right to the very top of the panel because we've removed the top margin. And since the paragraph tags have the top margin removed as well, we're getting exactly half an em between the h2 and the paragraph tag. So let's come over here and click OK. Now that we have the CSS rules in place to style the text in the panels, next we'll work on some CSS rules that will target the layout of the panels.

There are currently no FAQs about Create a Sliding Tabbed Panel with jQuery and Dreamweaver.

Share a link to this course
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.
Upgrade now


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

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 Create a Sliding Tabbed Panel with jQuery and 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
Welcome to the redesigned course page.

We’ve moved some things around, and now you can



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.

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