You are currently viewing the BOOK Beginning CSS: Cascading Style Sheets for Web Design, 2nd Ed; ISBN: 978-0-470-09697-0 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .

This rule applies to the parent <div> element. color is an inherited property, so text inside that <div> (but not inside a <p>) will be white. But text inside a <p> will be black, because you have a specific rule applying to <p> elements that takes precedence over inheritance.

The rule now applies to the <p> element instead of the parent <div> element. The <div> element is no longer absolutely positioned, so it appears in the normal flow of the document, which places it in the upper left hand corner of the screen. The <p> element is now absolutely positioned, so it appears roughly where the <div> element appeared before, but it has default margin applied to it by the browser, so it's shifted down a bit. The border in question is applied to the <div> element, not the <p> element, which is why you see the border in the upper left hand corner instead of applied to the <p> element.