Viewers: in countries Watching now:
This course shows how to use the combined power of Dreamweaver and CSS to create compelling, easy-to-maintain web page layouts. After demonstrating how to maximize Dreamweaver's built-in layouts (including HTML5 layouts), author Joseph Lowery reviews essential layout concepts such as the box model, document flow, and the proper use of floats. Next, the course covers how to develop an array of basic 2- and 3-column layouts from the ground up, and then how to customize them with advanced features like CSS3 rounded corners, faux columns, and Spry widgets. The course concludes with a demonstration of techniques for converting a desktop layout to one better suited for tablets and smart phones.
Now we are ready to fine tune this bright tabbed panel CSS. I will say that right now it actually doesn't look bad in terms of the basic colors, but I think I want to do some things to really make this standout. And the first thing I want to do is add in some rounded corners for our tabs. So let's go ahead and switch over to the All mode, and as I've mentioned in other videos, I do find it often a lot easier to work in All mode with the Spry CSS files, because they are so logically laid out.
So the first thing we want to change is TabbedpanelsTab. Now I am going to right-click and Go to Code. So I can address this. As you can see, let me switch to Code View, so you can see it all directly. If you lose it in Code View, if you just press your arrow keys left or right, Dreamweaver will reposition the window, so you can find it again. So there are quite a few properties here, but let's go ahead and add in some new ones right at the bottom. I will put my cursor right after the last one, and hit Return or Enter.
Now, first, I am going to put in the vendor specific rules. Instead of changing the entire border-radius, which I would do if this were an isolated Box, I want to change just the Top Right and the Top Left. Now there are different syntaxes for both the Mozilla and WebKit Browsers, so we'll need to use Dreamweaver's Code Hints to find the right ones. So let's start off with Mozilla, and put in the hyphen to get vendor specific preferences and there you see Mozilla. I will just hit Return now. Now, I do know that it's a border related one, so I am just going to go ahead and put border and then another hyphen.
Now I see the radius down below here, but it looks like there are other ones available to me. And there are in fact, individual ones for each corner. So I will go down to border-radius, Top Left. And press Return or Enter. And I want to set this to a value of 8 pixels. So again, we have to put in one for the Top Right. So I will type in moz-and border, and then I will just scroll down, select it here, and then press Return or Enter.
Save myself and you a little typing. So those are the first two. Now we need to switch over to WebKit. So hypen and a w, and that will give us the WebKit preference. Press Return. Now if you type in border, you'll start to see all of the various options there. And I can see that I have two that I want; that instead of border-radius Top Right, as it is in Mozilla, here it's border Top Right radius. So select that. Press Return and same value.
Again, we will bring in WebKit, type border, and then select the final one, which is border-top-left-radius. Same radius. Now to future proof our rounded corners, let's go ahead and put in the CSS 3 property, which Dreamweaver also supports in code hints and that's just border, and as I can see there's a border-bottom, I bet there is a border top, and there it is, border-top-left-radius. So it actually follows the WebKit syntax and we will that at 8 pixels and here's the final one, border-top-right-radius.
Okay, so I am going to go ahead and save this for right now. That was a lot of work, and let's go back over to Design View and because we are in Life View now, you should see your rounded corners. All right, looking pretty good. Next, I want to change the hover color to make a little bit more specific for what I need to modify and you can see that the next state here in the list is TabbedpanelsTabbedHover. Right now, it's kind of a dark gray, that's fine, but let's modify it and sample the dark blue that we see here on the right.
So I will click on the Color Swatch and then choose my blue color from the top there. So now when I go over and select, I am getting a dark background, but it's making it a little bit hard to read the labels. So we are going to need to modify and change the color. Now the first thing you might want to try is to go ahead and add in a Color property of white, so let's give that a shot. First thing I want to do is actually show only the set properties here. We have been showing all the properties in the List View. But because I want to get to my Add Property option, I am going to choose Show only set properties.
And now I can click on Add Property and let's put in a color and let's make that color white. Okay, let's give that a shot. Well, no change. So obviously there is something else that's preventing my white color from taking effect. So let' go ahead and remove our white color, since that doesn't have the effect that we want, so I will delete that. And now let's go back into Inspect mode in order to try to identify it. So I want to go to Current mode here, to use it in conjunction with Inspect mode.
So I will click on Inspect mode and then hover over the tabs and I see the color that is coming in that's set for this main color, but it doesn't really affect the hover state, and if I look at hover, that's the same CSS rule that we just tried to apply. So what we are going to need to do is to create a new rule that includes the hover state in Spry, and change to that color. So let's go over to where that color was set and I am going to use the Go to Code option here, and press my arrow key in order to locate that in Dreamweaver.
So here is that rule that we need to amend to add a hover state. So let's just copy that entire thing, and then I will paste it. And the class that we add here also discovered by using Live View is TabbedpanelsTabHover, and we only want to affect the color here, so I will remove those other two rules, and I am just going to put in FFF for white.
Okay, now let's take a look. Well, that seems to work, but look what happens when you roll over a selected state? This often can happen when you're making modifications to your CSS rules, is that one change might cascade and cause a problem in another rule. So we want to keep this, but fix this. So to do that, we are going to create one more rule, so I am going to select that rule, copy it and then place my cursor after it and paste it in, and I am going to add one more class after TabbedpanelsTabHover, and that is, .TabbedpanelsTabSelected.
When you take a look at the Live Code, you will see that it's Spry often puts in multiple classes and we can use that multiple classes to really target our selection. So now what I want to do with this rule, is I want to instead of making it white, let's find that blue color again, and sample that. And you will find that all the way up at the top there, and if I select in my CSS Styles over here, I can cause the CSS Styles panel in current mode to show that particular property, Click the Color Swatch and then sample the blue.
Okay, so let's take a look at that in Live View, and I will scroll down to where my tabs are and now when I scroll over the unselected state, I get exactly what I was looking for, and if I go to the selected state, I get a nice blue instead of the white. Now whether you keep these rules that we created that have Spry classes in them in the main.css, or you move them to SpryTabpanels.css, is a choice, it's up to you.
I tend to keep some in the same location, but that's up to you. Often when you are incorporating tabbed panels into a page, you will have to make adjustments to the existing content, as well as modifying the panel CSS to fully integrate them into your site, as we did in this video.
There are currently no FAQs about Layouts with CSS in Dreamweaver.
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.