Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [CSS]:first-child
AboutMe
post
Post #1





Grupa: Zarejestrowani
Postów: 261
Pomógł: 0
Dołączył: 24.02.2008

Ostrzeżenie: (0%)
-----


Witam,

Mam taki kod i chciałbym zastosować specjalny styl dla pierwszego .sidebar-title. Czy da się to jakoś zrobić przy pomocy :first-child albo innej pseudoklasy?

  1. <div id="sidebar">
  2.  
  3. <div class="sidebar-box">
  4. <div class="sidebar-title">...</div>
  5. <div class="sidebar-box-child">
  6. ...
  7. </div>
  8. </div>
  9.  
  10.  
  11. <div class="sidebar-box">
  12. <div class="sidebar-title">...</div>
  13. <div class="sidebar-box-child">
  14. ...
  15. </div>
  16. </div>
  17.  
  18. </div>


Ten post edytował AboutMe 16.12.2012, 13:08:32
Go to the top of the page
+Quote Post
piotrex41
post
Post #2





Grupa: Zarejestrowani
Postów: 168
Pomógł: 26
Dołączył: 15.09.2011
Skąd: Wrocław

Ostrzeżenie: (0%)
-----


Ja bym spróbował zrobić to jakoś tak:
Kod
div#sidebar div.sidebar-box:first-child div.sidebar-title {}
Go to the top of the page
+Quote Post
AboutMe
post
Post #3





Grupa: Zarejestrowani
Postów: 261
Pomógł: 0
Dołączył: 24.02.2008

Ostrzeżenie: (0%)
-----


Działa, dzięki!
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 23.08.2025 - 12:09