использование :first-child
Привет :) .
IE7 не поддерживает :before.Наткнулся на :first-child и захотелось сделать так <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Документ без названия</title> <style> *{padding:0;margin:0} div#boo{position:relative; width:300px;top:100px; left:200px; height:300px; border:1px solid red;} html,body{height:100%;position:relative} /*div#boo:before{position:absolute;content:' '; top:-40px; left:-60px; width:100px; height:60px; border:1px solid green}*/ div#boo:first-child{position:absolute; top:-40px; left:-60px; width:100px; height:60px; border:1px solid olive} </style> </head> <body> <div id="boo"><p>relative xoxoxo</p></div> </body> </html> Почему не работает? |
Хотел сделать одно, не придумал как, влепил от балды другое свойство, да ещё при этом сделав оксюморонный финт: div#boo:first-child. Id и так один на страницу обязан быть.
Знатный юмор в общем. |
first-child это ж уже из CSS3. Вот старые браузеры и не поддерживают
|
Ну как так можно?
http://htmlbook.ru/css/first-child |
Часовой пояс GMT +3, время: 21:40. |