Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
Now, we're going to add the promo graphics to the promo areas using CSS. But before we can do that, we need to put some custom classes in the HTML so that we can target each individual promo. So let's come back to our index.html file. Let's find our promo container, and let's find the three promos that are inside the promo container. On the first one, let's come up here to the div with the class of promo. Hit a space, type the number one. We're using the actual name because we can't use numbers as a class name.
Let's find the second one. Type in two. And let's find the third one and type in three. Let's save our work. Now, we have custom classes on each one of the individual promos. Let's come back to screen_styles.css. After our promo p rule, let's hit a few returns. Let's type in .promo. This is going to target the outermost container of each of the individual promos. Let's set our brackets. We're going to come in here and set background- repeat to no-repeat so that that will be used for all of the individual promos.
Let's hit a return. Let's type .promo.O-N-E, so promo.one. Put in our brackets. In here, we're going to come in here and specify background image. Set url, set the parentheses, ../ to come out the root, images/promo_1.jpg, then a semi-colon, and you come in here and copy this entire rule.
Let's paste it two more times. For the second one, change .one to .T-W-O for two. Let's come over and change the file name from promo_1.jpg to promo_2.jpg. Change the last one to .three and then change the 1, 2, or 3.jpg for the file name, then choose File > Save. Let's come out and look at this in a browser.
Now, what we see here is the individual graphics are showing up inside of each container, so inside of each individual promo we see the individual graphics we created from Photoshop. Now, of course, you'll notice that the text is actually overlapping the individual graphics. We're going to address this when we start working on the CSS rules for our layouts.
Get unlimited access to all courses for just $25/month.Become a member
120 Video lessons · 58598 Viewers
119 Video lessons · 67732 Viewers
84 Video lessons · 16991 Viewers
125 Video lessons · 29879 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.