Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
Now that we're ready to create our CSS, let's bring back our sketch for a second and take a look at some of the measurements we're going to be using. We were looking at the sketch earlier in order to see what divs we needed to nest inside of each other. Now I want to take a look at this real quick and look at the sizing of the containers we need to create. So the outermost container is going to be 700 x 350 pixels. The navigation items are going to be 18 x 18 pixels. These are going to house the sprite graphics we made inside of Photoshop for the nav graphics. And then we're going to have a caption background of 700 x 300 that we created inside of Illustrator.
Inside of the caption itself, the marquee_caption, we have an image tag where we bought in our flag. We have an h2 element that's going to control the heading. We have two p tags that are going to control the sizing of the caption. The marquee_nav is also going to be inside of this area here. We're going to use absolute Positioning to position this over to the side. So at this point, let's put our sketch away, and let's come into our marquee.css. With our index file opened, we can see this CSS file being referenced in Dreamweaver's CSS panel. Or if you're following along in a text editor, you can simply just type in the values.
So let's start by going to marquee.css, let's click New Rule, and we're going to first start by creating a class, and we're going to create a class that is the marquee_container. Let's choose OK. Let's define the pProperties of the marquee_container. The first thing I want to do is come down to Positioning and we're going to set positioning on this to be relative. This means that all the children inside of this object will position themselves based on the top corner of the marquee.
Let's go to Box Properties. We're going to set a Width of 700, Height of 350. Let's come down to Margin. Let's take off Top margin. We're going to set Top and Right to 0, Bottom of 30 pixels, Left of 0. And you can adjust these numbers based on where the marquee is positioning on your particular homepage design. Here I'm assuming that the marquee is going to be at the top, so I want everything to push away from the bottom.
And then on Positioning, let's go to Overflow, and we're going to set Overflow to Hidden. This way when the marquee div inside is outside of the bounding area of the marquee_container, it will be hidden. This will give us the masking effect of the caption moving down underneath the marquee area. Let's click OK. I can toggle this open in Dreamweaver and see we have our first class created.
Let's come in here and create our next rule. This is going to be a class, and this will be marquee_photos. Let's choose OK. Marquee_photos. Under Positioning, we're going to choose Absolute. With an absolute setting, we have to give it a position. We'll choose Top and Left being 0. Then we'll choose OK. Let's create another CSS rule. This one will also be a class, marquee_caption. Choose OK.
Box properties for this one, 700 pixels wide. Under Margin, I'll choose 0, Same for all. For Padding, we're going to come in here and set 15 on the Top, 0 on the Right, 10 on the Bottom, 0 on the Left. Let's go to Positioning. We're going to set absolute positioning. We're going to set the Top to 340 pixels and the Left to be 0. Let's come over to Type. Under Color, let's make the color White.
Then let's go to Background. We're going to choose Browse, myMarquee/images/ template/marquee_caption.png. Click Choose. We're going to set the Background- position to 0, 0, and no repeat and click OK. If you don't see the update change inside of Dreamweaver, you can come up and hit Live view and then click Live view again just to force Dreamweaver to update the stage.
So we should see our caption looking something like this. At 340 pixels, this gives us that 10 extra pixels from the height of 350 based on the measurements of our sketch, so that now the caption will show up down below here and just show the top 10 pixels of that tab. In the next movie, we'll continue on creating our CSS rules.
Get unlimited access to all courses for just $25/month.Become a member
82 Video lessons · 103207 Viewers
58 Video lessons · 55858 Viewers
61 Video lessons · 89917 Viewers
56 Video lessons · 105062 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.