before-after-positioned-003.html (1077B)
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"> 2 <html> 3 <head> 4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 5 <title>CSS Test: :before/:after pseudo-elements - 'position:absolute'</title> 6 <link rel="author" title="James Hopkins" href="mailto:james(at)idreamincode.co.uk"> 7 <link rel="help" href="http://www.w3.org/TR/CSS21/generate.html#before-after-content"> 8 <link rel="match" href="before-after-positioned-002-ref.html"> 9 <meta name="assert" content="Since the restriction on assigning positioning schemes to the :before and :after pseudo elements was lifted in CSS 2.1, this tests whether 'position:absolute' can be correctly applied to both pseudo elements."> 10 <style type="text/css"> 11 #test:after, 12 #test:before{ 13 background:blue; 14 bottom:0; 15 content:""; 16 height:100px; 17 position:absolute; 18 right:0; 19 width:50px; 20 } 21 #test:before{ 22 bottom:0; 23 right:50px; 24 } 25 </style> 26 </head> 27 28 <body> 29 <p>Test passes if there is a square (four equal sides) at the bottom right of the page.</p> 30 <div id="test"></div> 31 </body> 32 33 </html>