Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member

Adding CSS rules for the container

From: Create an Interactive Homepage Marquee with jQuery and Dreamweaver

Video: Adding CSS rules for the container

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.

Adding CSS rules for the container

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.

Show transcript

This video is part of

Start learning today

Get unlimited access to all courses for just $25/month.

Become a member
Sometimes @lynda teaches me how to use a program and sometimes Lynda.com changes my life forever. @JosefShutter
@lynda lynda.com is an absolute life saver when it comes to learning todays software. Definitely recommend it! #higherlearning @Michael_Caraway
@lynda The best thing online! Your database of courses is great! To the mark and very helpful. Thanks! @ru22more
Got to create something yesterday I never thought I could do. #thanks @lynda @Ngventurella
I really do love @lynda as a learning platform. Never stop learning and developing, it’s probably our greatest gift as a species! @soundslikedavid
@lynda just subscribed to lynda.com all I can say its brilliant join now trust me @ButchSamurai
@lynda is an awesome resource. The membership is priceless if you take advantage of it. @diabetic_techie
One of the best decision I made this year. Buy a 1yr subscription to @lynda @cybercaptive
guys lynda.com (@lynda) is the best. So far I’ve learned Java, principles of OO programming, and now learning about MS project @lucasmitchell
Signed back up to @lynda dot com. I’ve missed it!! Proper geeking out right now! #timetolearn #geek @JayGodbold
Share a link to this course

What are exercise files?

Exercise files are the same files the author uses in the course. Save time by downloading the author's files instead of setting up your own files, and learn by following along with the instructor.

Can I take this course without the exercise files?

Yes! If you decide you would like the exercise files later, you can upgrade to a premium account any time.

Become a member Download sample files See plans and pricing

Please wait... please wait ...
Upgrade to get access to exercise files.

Exercise files video

How to use exercise files.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.


Exercise files

Exercise files video

How to use exercise files.

For additional information on downloading and using exercise files, watch our instructional video or read the instructions in the FAQ .

This course includes free exercise files, so you can practice while you watch the course. To access all the exercise files in our library, become a Premium Member.

Join now Already a member? Log in

Are you sure you want to mark all the videos in this course as unwatched?

This will not affect your course history, your reports, or your certificates of completion for this course.


Mark all as unwatched Cancel

Congratulations

You have completed Create an Interactive Homepage Marquee with jQuery and Dreamweaver.

Return to your organization's learning portal to continue training, or close this page.


OK
Become a member to add this course to a playlist

Join today and get unlimited access to the entire library of video courses—and create as many playlists as you like.

Get started

Already a member ?

Become a member to like this course.

Join today and get unlimited access to the entire library of video courses.

Get started

Already a member?

Exercise files

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships. Learn more

Get started

Already a Premium member?

Exercise files video

How to use exercise files.

Ask a question

Thanks for contacting us.
You’ll hear from our Customer Service team within 24 hours.

Please enter the text shown below:

The classic layout automatically defaults to the latest Flash Player.

To choose a different player, hold the cursor over your name at the top right of any lynda.com page and choose Site preferences from the dropdown menu.

Continue to classic layout Stay on new layout
Exercise files

Access exercise files from a button right under the course name.

Mark videos as unwatched

Remove icons showing you already watched videos if you want to start over.

Control your viewing experience

Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.

Interactive transcripts

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.

Are you sure you want to delete this note?

No

Your file was successfully uploaded.

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked
Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.