13.07.2015 Views

Beginning CSS: Cascading Style Sheets for Web Design, 2nd ...

Beginning CSS: Cascading Style Sheets for Web Design, 2nd ...

Beginning CSS: Cascading Style Sheets for Web Design, 2nd ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 11: PositioningElements that are absolutely positioned are positioned, by default,relative to the browser’s viewport. This is done using theposition property. The position property is used in conjunctionwith four offset properties, which are used to control where onthe screen an absolutely positioned element is placed.Top, LeftTop, RightBottom, LeftBottom, Right2. Save the preceding document as Example_11-1.html.3. Enter the following <strong>CSS</strong> in your text editor:body {background: yellowgreen;}p {margin: 10px 110px;}div {position: absolute;background: yellow;padding: 5px;width: 100px;height: 100px;}div#top-left {top: 0;left: 0;border-right: 1px solid black;border-bottom: 1px solid black;}div#top-right {top: 0;right: 0;border-left: 1px solid black;border-bottom: 1px solid black;}div#bottom-left {bottom: 0;left: 0;379

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!