Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
When working with CSS, you're likely to spend a good deal of time modifying the styles that you've already written. In this movie, we are going to explore some of the many techniques available in Dreamweaver to edit your styles visually using the CSS Styles panel. Just so I can see a little bit more of my CSS Styles panel, number one, I am going to make sure I can see it, and I am focused on it. Then I am going to go to the Files panel, and I am going to double-click the tab of the Files panel which will collapse it, and that gives me a lot more room for my CSS Styles panel. Now, one of the things I notice, right off the bat, is that we are supposed to have a little bit of separation between our page content and the top of the page.
So I should be seeing a little bit of blue up here, and I am not. So I am going to go right over to my CSS Styles panel, I am going to find the body tag, and I am going to go ahead and double-click that. Now, when I double-click the body tag, notice that the CSS Rule Definition dialog box comes up. This is the default, but you can change it through the Preferences so that that might open up in Code view, or it might focus down on the Properties Inspector. So I am just going to go to my Box properties here, deselect Same for all for Margin, and I am just going to give it a Top Margin of 25 pixels. When I click OK, notice that that is added right here to my list of properties, and now I see the proper spacing at the top.
So that's a very quick and easy way to make an edit. The next thing I am going to do is in my CSS Styles panel, I am going to find the h1 tag, which is right here. I am going to click on the h1 tag and when I select that, it shows me the properties for that in this pane below it. Now, notice that we are in All View right now. So if you don't see this, make sure you are not in Current View. You want to be in All View. Again, you just want to click once on the h1 tag to select that. Now, this is my favorite way of editing styles, the way I am about to show you. This is just so quick and so easy, and it's a lot like hand-coding. If I select, and highlight h1, I can come right down here to this little link that says, Add Property.
Now, if I click that, I can go ahead and choose from the pulldown menu any property I want to add, or if you know what you want to do, you can just type in something like color, for example. Then if you hit Tab, you get the Color Picker that you can choose from, or you can just go ahead and type in a value yourself. So in this case, I want to do #193742, although that green is pretty nice. Now, as soon as I type that in and hit Return, it goes ahead and changes it. So you can see the Adding Properties to existing rules is amazingly simple using this.
You just click Add Property, type in what you want to do. It goes in, adds it to your code, and you are good to go. Now, I am going to click right here inside the body copy. So I am inside our paragraph here. Instead of looking at the All view, I am going to switch it over to the Current view. Now, when I do that, I get three sections for my Styles panel. One is a Summary, and it's giving me all of the properties that are applying to this particular element, in this case the paragraph. Then I get all the Rules that are applying, and these rules are applying within the cascade. There are two views here. There is the cascade of rules, and then there is information about a selected property.
So here, if I selected a property, it would tell me where that property could be found. But if I hit Cascade, it just shows me all of the different rules that are applying to this one, the bottom rule being the closest one to it. Now, if I look in the Cascade section here and scroll down and choose this P selector, now the properties for the Paragraph Selector are coming up. Notice that every time I click on one of these, I get a different set of properties. So that allows you to highlight an element and then sort of go up or down the cascade as you need to to find the property that you want to modify or change. I am going to select the Paragraph Selector, and I'll add another property right down here using the same method that we just did a minute ago.
I am going to do line-height. So again, you can just type that in if you like typing it in, or if you can't type like me, you want to grab the pulldown menu. I'll hit tab to move over, and I am just going to do 1.8. I am not going to set it again to measurement. I will let it default to Multiple, and now we have a line height that is what we wanted for that particular element. There are also some things that you can do with the CSS Styles panel that you pretty much can't do any other way except for hand-coding. I am going to switch back to All, for example, and I am going to click right up here in this headline Tours, because it does not look the way it's supposed to look.
It's supposed to have a border underneath it. It's supposed to be a little bit smaller. Well, if I look at this, I can see using the Tag Selector that this is an h1 with an ID of pageID, in lowercase p, uppercase ID. If I look over at my styles, and I scroll down little bit, I can see that within my Styles, and you know I have to scroll a little bit to get down here, there it is, that's what I am looking for, you'll notice that right here we have a selector that says #mainContent h1#pageid. But notice that the id is lowercase, but the actual ID itself is uppercase.
So the selector is wrong. Instead of just being able to edit properties, one of the things that the CSS Styles panel allows us to do is edit the rules themselves. So if I click on that rule once to select it and then click one more time, notice that it highlights the rule, and I can change the selector right here without having to go into the code. That is a really powerful feature so I am going to change that to ID, hit Return, and now notice the styling is correct. So if you write a selector, and it's not giving you the correct styling, you can check it, make sure it's the selector that you need and if you need to rename it, you can go ahead and rename it right here without having to go back in your code.
That's pretty cool. So I think even if you're like me, and you rely on hand coding for the creation of most of your styles, Dreamweaver has some truly impressive methods for making quick edits to your CSS without having to go back into the code. Keep in mind you can also edit your styles through the Properties Inspector, as well. By giving you so many different ways to work with your CSS, Dreamweaver allows you to find the methods that suit your own personal preferences. My advice is to become comfortable with all the editing methods so that you can use the one that best suits the current situation and your personal preferences.
Get unlimited access to all courses for just $25/month.Become a member
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.