The page is looking good but the borders on the h2 tags still run up to and

The page is looking good but the borders on the h2

This preview shows page 248 - 252 out of 650 pages.

The page is looking good, but the borders on the <h2> tags still run up to and behind the sidebar. That just doesn’t look good, but you can fix it easily. 9. Locate the <h2> style and add the overflow property, like so: h2 { font-size: 1.5em; font-family: "Arial Narrow", Arial, Helvetica, sans-serif; color: rgb(249,107,24); border-top: 2px dotted rgb(141,165,22); border-bottom: 2px dotted rgb(141,165,22); padding-top: 5px; padding-bottom: 5px; margin: 15px 0 5px 0; overflow: hidden; } Setting the overflow property to hidden hides the borders that pass beyond the headline text and under the floating element. 10. Save the file and preview the web page in a browser.
239CHAPTER8No matter how much you gussy up your text or fiddle with borders and mar-gins, nothing affects the appearance of your site more than the images you add to it. And once again, CSS gives you more image control than HTML ever dreamed of. You can work with graphics in CSS on two fronts: the <img>tag and the background-imageproperty (which lets you place an image in the background of any tag on a page).This chapter delves into some of the creative ways you can deploy images with CSS. The best way to learn how to use graphics in CSS is to see them in action, so this chapter has three—count ’em, three—tutorials. By creating a photo gallery web page and using images for overall page styling, you’ll be an image-slinging pro in no time.Discovering CSS and the <img> TagThe venerable <img>tag has been the workhorse of photo-heavy websites since the beginning of the World Wide Web. Even sites without photos use it to add logos, navigation buttons, and illustrations. While CSS doesn’t have any properties specifi-cally aimed at formatting images, you can take advantage of the CSS properties you’ve already learned to enhance your site’s graphics. For example, the borderproperty is a quick and simple way to frame an image or unify the look of a gallery of photos. Here’s a rundown of the CSS properties most commonly used with images:Borders.Use one of the many borderproperties (page 202) to frame an image. You’ll see an example of this in the tutorial on page 273. Since each border side

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture