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

Styling the tooltip

From: Create a Tooltip with jQuery and Dreamweaver

Video: Styling the tooltip

Now we're going to add some CSS properties to the tooltip.css file. Now if your version of Dreamweaver has the related files tab up here, you can see that in the HTML file, we have the tooltip.css, jquery, and tooltip.js files. We can click on these related files and get access directly to those individual files. Also, if I am in the Source Code for the HTML, like we were in the last movie, you'll see over in the CSS Styles panel, all of the CSS rules that relate to this file. And this is actually the tooltip.css file.

Styling the tooltip

Now we're going to add some CSS properties to the tooltip.css file. Now if your version of Dreamweaver has the related files tab up here, you can see that in the HTML file, we have the tooltip.css, jquery, and tooltip.js files. We can click on these related files and get access directly to those individual files. Also, if I am in the Source Code for the HTML, like we were in the last movie, you'll see over in the CSS Styles panel, all of the CSS rules that relate to this file. And this is actually the tooltip.css file.

Now we're going to need to go into the CSS code itself in order to add some of the CSS3 properties. While Dreamweaver 5 and 5.5 support some CSS3, we don't have anything in the interface to help us visually code some of that. So we're going to start by adding some CSS rules using the CSS Styles palette and then we'll open up the CSS and add additional rules. Now if you don't see the CSS Styles palette, you can get to that by going up to the Window menu, and coming down to CSS Styles. Inside of the CSS Styles palette, let's come down here and click on this button here; the Create New CSS Rule.

Now the first rule we want to create is going to be an ID. So let's come up here and choose an ID. We want to target that new container we created for our tooltip; so #tooltip_container. Let's choose OK. Next, we're going to set some properties inside of here. Down here for color, let's come down and choose white. Let's come over to the Box properties. Under Padding, Same for all, let's put in 20 pixels, and then let's come over to Positioning and let's set the position value to absolute. Let's click OK.

So those are all of the rules that we can set within the interface. To open up the CSS file, let's come up to the File menu. Let's choose Open. From the desktop, let's go into myTooltip > includes. Let's open up tooltip.css. Now we're going to be looking at the source code of the CSS. Let's scroll down. I have a comment in here that I added called tootip, and we should see tooltip_container down here. So after the position property, let's hit Return.

Let's start with max-width: 200 px; let's hit a Return. Let's set a background color. The background color, we're going to use the color space RGBA, beginning and ending parentheses, then a semicolon. So what RGBA does is lets us specify red, green, and then blue and then the alpha or the transparency setting for that color. So inside of the parentheses, to get black, we want to do 0, 0, 0, and then next we want to set the alpha property; so 0.85.

This is going to be 85% opaque or 15% transparent. Next line, we want to set the rounded corners. So we're going to first start by adding two rendering engine flags; one for WebKit which powers Chrome, Safari, Android, and the iOS, and the other one is going to be for Mozilla that powers Firefox. So let's start with the WebKit browser. So -webkit-border-radius, and notice again Dreamweaver is helping us with the CSS3 as long as we're in the code view.

So border radius for WebKit, 12 pixels, semicolon, let's hit a Return. Let's set one for Mozilla; -moz-border-radius: 12px, and then on the next line we're going to use the straight CSS3 property; border-radius: 12px; IE 9 actually supports border radius straight out and the Mozilla browser is soon to be removing their Mozilla flag, so we won't need to do that anymore, and the WebKit browsers are still using those border radius flags.

Since CSS3 is not a final specification yet, these web flags allow some of the rendering engines to specify how they are interpreting CSS3 before the standard becomes finalized. At this point, save your CSS file. Let's come up to the File menu and let's open the IE version of our CSS file; so tooltip_ie.css. Now inside of here we're going to add pound sign, tooltip_container, beginning and ending brackets, let's split that open.

Now what we're going to do in here is redefine some of those properties that are set with CSS3. The first one is going to be width. We're going to set that to 200 pixels, since IE 7 or 8 don't understand the max-width setting. Next, we need to use a different color space from RGBA. So first, let's type background, colon, space, set none. We're going to clear out all the background settings. Next, we're going to set background image. We're going to use that semi- transparent PNG file since again we can't use the RGBA space with the transparency setting.

So for background image, let's come down and choose Browse. From the Desktop > myTooltip > images, let's choose ie_transparency.png. Then, click Choose, then put a semicolon. Once you've added these rules, hit save. Let's come back to our HTML file. Let's come down inside of the div with the ID tooltip_container and let's add in Test text. This way we can actually see how the text is being formatted inside of here. Then, let's choose File > Save All to make sure all of the CSS and related files are saved.

Then let's choose File > Preview in Browser, and pick the browser you'd like to preview this in. Once this loads, you'll see after the footer element, we have a rounded corner box, semi-transparent, so it's picking up a darker shade of the blue. The type inside is white. So now that we have our tooltip_ container styled, next we'll work on adding some additional data into our anchor links that we can actually trigger our tooltip from.

Show transcript

This video is part of

Image for Create a Tooltip with jQuery and Dreamweaver
Create a Tooltip with jQuery and Dreamweaver

18 video lessons · 4197 viewers

Chris Converse
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.

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