Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> Data jako selektor
hobibit
post
Post #1





Grupa: Zarejestrowani
Postów: 23
Pomógł: 0
Dołączył: 22.03.2008

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


Witam, chciałem zapytać o możliwości zarządzania css za pomocą data

Można używać data w taki sposób:
  1. <div data-numer="2">
  2.  
  3. [data-numer="2"] {
  4. /* Styles */
  5. }


Czy jest jakiś sposób (ja nie znalazłem chociaż trochę szukałem) żeby zrobić coś takiego:
  1. [data-numer>"2"] {
  2. /* Styles */
  3. }
Go to the top of the page
+Quote Post
rocktech.pl
post
Post #2





Grupa: Zarejestrowani
Postów: 587
Pomógł: 131
Dołączył: 8.02.2010

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


Witam.

Zerknij na dokumentację selektorów atrybutów w CSS.

  1. *[data-numer=2] {
  2. color : red
  3. }


--------------------
Despite the tons of examples and docs, mod_rewrite is voodoo. Damned cool voodoo, but still voodoo. --Brian Moore

I never go looking for a sucker. I look for a Champion and make a sucker of of him. --Amarillo Slim


Home-made : js-gui-classes | Accordion | Tabs | Carousel / php-sms-classes | Obsługa bramki SMS MultiInfo | Obsługa bramki SMS Mobiltek
Go to the top of the page
+Quote Post
hobibit
post
Post #3





Grupa: Zarejestrowani
Postów: 23
Pomógł: 0
Dołączył: 22.03.2008

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


Nie to próbuje zrobić. Podstawowa opcja działa bez problemu. Ale chce zrobić selektor który będzie edytować wszystkie div-y z data-numer większe niż 2 (na przykład).
Go to the top of the page
+Quote Post
rocktech.pl
post
Post #4





Grupa: Zarejestrowani
Postów: 587
Pomógł: 131
Dołączył: 8.02.2010

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


Na ten moment masz do dyspozycji.

Cytat
E[foo="bar"] an E element whose "foo" attribute value is exactly equal to "bar" (atrybut równa się "bar")
E[foo~="bar"] an E element whose "foo" attribute value is a list of whitespace-separated values, one of which is exactly equal to "bar" (atrybut zawiera "bar" "bar bar2")
E[foo^="bar"] an E element whose "foo" attribute value begins exactly with the string "bar" (atrybut zaczyna się od "bar")
E[foo$="bar"] an E element whose "foo" attribute value ends exactly with the string "bar" (atrybut kończy się na "bar")
E[foo*="bar"] an E element whose "foo" attribute value contains the substring "bar" (atrybut zawiera "bar")
E[foo|="en"] an E element whose "foo" attribute has a hyphen-separated list of values beginning (from the left) with "en" (zaczyna się od "en" "en-US")




--------------------
Despite the tons of examples and docs, mod_rewrite is voodoo. Damned cool voodoo, but still voodoo. --Brian Moore

I never go looking for a sucker. I look for a Champion and make a sucker of of him. --Amarillo Slim


Home-made : js-gui-classes | Accordion | Tabs | Carousel / php-sms-classes | Obsługa bramki SMS MultiInfo | Obsługa bramki SMS Mobiltek
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: 20.08.2025 - 10:12