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

Adding CSS styles to the text

From: Create a Sliding Tabbed Panel with jQuery and Dreamweaver

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.

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.

Show transcript

This video is part of

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.

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 preferences from 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.

Learn more, save more. Upgrade today!

Get our Annual Premium Membership at our best savings yet.

Upgrade to our Annual Premium Membership today and get even more value from your lynda.com subscription:

“In a way, I feel like you are rooting for me. Like you are really invested in my experience, and want me to get as much out of these courses as possible this is the best place to start on your journey to learning new material.”— Nadine H.

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.