Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> Problem z tyldą ( ~ )
Kris Groove
post
Post #1





Grupa: Zarejestrowani
Postów: 7
Pomógł: 0
Dołączył: 2.12.2011

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


Witam smile.gif

Po zaznaczeniu input, <div> z klasa pages powinien sie rozszezyc, ale tego nie robi.

  1.  
  2. <div>
  3. <input type="radio" name="radio-set" id="control-1"/><br />
  4. </div>
  5. <section>
  6. <div class="pages"></div>
  7. </section>
  8.  


  1. section .pages
  2. {
  3. width:100px;
  4. height:100px;
  5. background:red;
  6. transition:width 2s;
  7. -moz-transition:width 2s;
  8. -webkit-transition:width 2s;
  9. -o-transition:width 2s;
  10. }
  11.  
  12. #control-1:checked ~ section .pages
  13. {
  14. width:300px;
  15. }


Lecz gdy usune z poczatku <div> i potem </div> a srodek zostawie to dziala

http://jsfiddle.net/t9d9F/7/

Ten post edytował Kris Groove 23.01.2013, 23:35:44
Go to the top of the page
+Quote Post
tolomei
post
Post #2





Grupa: Zarejestrowani
Postów: 450
Pomógł: 135
Dołączył: 18.11.2010
Skąd: Wschowa

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


Witaj.

Cytat
The general sibling selector is available in CSS3, and the combinator used in this selector is a tilde character (~). The selector matches elements that are siblings of a given element.


Tylda dopasowuje się do rodzeństwa - to znaczy do elementu, który jest na tym samym poziomie w drzewie DOM i ma tego samego rodzica.
To by wyjaśniało wszystko.

Użyj jQuery jeśli masz taką możliwość.

Pozdrawiam.


--------------------
“ Computers are good at following instructions, but not at reading your mind. ”
- Donald Knuth
Go to the top of the page
+Quote Post

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

 



RSS Aktualny czas: 19.08.2025 - 08:50