Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
All right! Our next task is to assign IDs to all of these divs that we just created and we might start to give them a basic style as well. KompoZer has a great tool for creating styles within KompoZer, and you don't have to know a whole lot of HTML to use it. It's this icon at the top called the CSS Editor and if you click that, you'll see that we have a screen where we can have an internal style sheet and I am going to show you how to make an external style sheet.
Remember that an internal style sheet means that the styles are incorporated at the head of the document, using the style tag. These are called embedded style sheets, another term perhaps you've heard somewhere. An external style sheet is a separate file with all the styles in it. Most content management systems are going to work better with an external style sheet than they will with an internal style sheet, and it will make maintenance easier in the long-term. So what we're going to do is I am going to click on Internal stylesheet and I'm going to say Linked stylesheet.
It's going to ask me some questions here and I'm just going to say Create Stylesheet. When I go back to Internal stylesheet, I now get to say Export stylesheet and switch to exported version. It will ask me what I want to call that stylesheet. Now if I was building this site for Joomla! and Joomla! templates, I would need to have a folder called images and I'd need to have a folder called css. My images folder contains my sliced-up graphics and my css folder would contain the style sheets that I'd be using with my Joomla! template.
Other content management systems may have different structures they require for organizing your style sheets and your images. You may want to follow that structure instead. I'm going to go into the css folder and I am going to call this default.css. You'll see that the screen updates so that we have css, the folder, default.css, which is the name of the stylesheet up here in the left-hand column. If I click the plus sign, you don't see anything underneath. That's because we haven't created any styles yet.
Now let's go ahead and create some styles. I am going to once again go to the Paint icon and I'm going to go to Style rule, which will create a new style for me. And as you can see, I can create many kinds of styles. I am just going to create a custom style rule and I'm going to call this first one #wrapper and I am going to create the style rule. At this point I can assign various attributes to the style that I just created. In the case of wrapper, this is the div that's outside of everything.
This is a fixed width design, so we're going to want to make wrapper 900 pixels wide. Why 900 pixels? Because that's how wide the graphic designer designed the graphic, the white area of the webpage. So I am going to go to Box and I am going to set the Width to 900 pixels. I'm also going to set the Left Margin to auto and the Right Margin to auto. This little trick here will center the wrapper div directly in the middle of the webpage, and all the other divs will become 900 pixels wide as well, and they'll fit nicely inside.
Next, I am going to create another style. Once again back here to the Paint palette and saying new style rule. I am going to create one called #header, and at this point I am just going to create a whole bunch of styles without assigning any more attributes to them. We'll go back and we'll assign the attributes in a little while. We'll create a style rule for nav. We'll create a style rule for contentwrapper. We'll create a style rule for content.
We'll create a style rule for left, and we'll create a style rule for footer. Now that we've created all of these IDs, now we need to go and assign them to the divs. So I am going to say OK, which will close the Stylesheet window, and now what I am going to do is, using my DOM Explorer, I'm going to select the first div. Down here in the breadcrumb, if I right- click on div, there's a flyout here for ID and I can choose wrapper.
See how that shrunk in the width and it's centered it nicely on the page. Note that the bar on top tells you that it's 900 pixels wide now. So that's our first div. Our second div is header. So once again this is a right-click or a Ctrl+Click on the div, ID > header and the ID of nav, the ID of contentwrapper, the ID of left, and the ID of content, and finally the ID of footer.
So all of our divs have been assigned IDs and we're ready to start doing some more styling and dropping some images into our design, which is what we'll do next.
Get unlimited access to all courses for just $25/month.Become a member
58 Video lessons · 61387 Viewers
61 Video lessons · 93565 Viewers
82 Video lessons · 104392 Viewers
56 Video lessons · 107867 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.