aaron Posted April 17, 2013 Report Share Posted April 17, 2013 Подскажите.есть такой код - http://cdpn.io/Dcysfнужно применить float:left к первому div class="news" внутри блока div class="content".есть какая-то альтернатива псевдо-селектору first-child?по-моему, есть какая-то? что-то типа дочернего или сестринского селектора. Quote Link to comment Share on other sites More sharing options...
0 decode Posted April 17, 2013 Report Share Posted April 17, 2013 :nth-child(1) Quote Link to comment Share on other sites More sharing options...
0 Kray Storm Posted April 17, 2013 Report Share Posted April 17, 2013 (edited) Есть еще :nth-of-type. А если там внутренних <div> так и будет всего два, то можно и через соседний селектор. А чем :first-child не угодил? Edited April 17, 2013 by Kray Storm Quote Link to comment Share on other sites More sharing options...
0 npofopr Posted April 18, 2013 Report Share Posted April 18, 2013 Можно еще через js дать ему любой класс :-) Quote Link to comment Share on other sites More sharing options...
0 Great Rash Posted April 18, 2013 Report Share Posted April 18, 2013 А нафиг альтернатива? first-child прекрасно работает в ИЕ7, а значит везде. Quote Link to comment Share on other sites More sharing options...
0 aaron Posted April 18, 2013 Author Report Share Posted April 18, 2013 Сделал так - http://cdpn.io/nLHKmfirst-child и last-child меня полностью устраивают. Но я начинающий верстальщик, и с вопросами кроссбраузерности конкретно еще не сталкивался.Сомнения возникли как из-за того, будут ли first-child и last-child кроссбраузерным решением в данном случае.И вопрос еще как раз. На сегодняшний день при верстке про IE6 можно уже практически забыть? И смотреть только в сторону IE7-8? Quote Link to comment Share on other sites More sharing options...
0 npofopr Posted April 18, 2013 Report Share Posted April 18, 2013 И вопрос еще как раз. На сегодняшний день при верстке про IE6 можно уже практически забыть? И смотреть только в сторону IE7-8?http://www.w3schools.com/browsers/browsers_explorer.asp Quote Link to comment Share on other sites More sharing options...
0 SelenIT Posted April 18, 2013 Report Share Posted April 18, 2013 Для рунета можно уже и про IE7 практически забыть. Оставить им минималистичную версию (а-ля мобильная) — и сойдет. Quote Link to comment Share on other sites More sharing options...
Question
aaron
Подскажите.
есть такой код - http://cdpn.io/Dcysf
нужно применить float:left к первому div class="news" внутри блока div class="content".
есть какая-то альтернатива псевдо-селектору first-child?
по-моему, есть какая-то? что-то типа дочернего или сестринского селектора.
Link to comment
Share on other sites
7 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.