Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
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.
Get unlimited access to all courses for just $25/month.Become a member
82 Video lessons · 98095 Viewers
61 Video lessons · 85367 Viewers
71 Video lessons · 69378 Viewers
56 Video lessons · 101735 Viewers
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
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.
Your file was successfully uploaded.