Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> kwadrat przed tekstem
Ninanoki
post 8.05.2012, 20:24:35
Post #1





Grupa: Zarejestrowani
Postów: 36
Pomógł: 0
Dołączył: 25.10.2007

Ostrzeżenie: (30%)
XX---


czy istnieje jakiś sposób na wstawienie kolorowego kwadratu (obrazek lub div) przed tekst tak jak na obrazku?
Go to the top of the page
+Quote Post
sunpietro
post 9.05.2012, 08:09:43
Post #2





Grupa: Zarejestrowani
Postów: 262
Pomógł: 26
Dołączył: 23.01.2009
Skąd: eZ Systems

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


możesz stworzyć obrazek z kwadratem, a potem ustawić odpowiednio duży padding lewy lub stworzyć pustego diva i dać mu display: block + wymiary i kolor oraz margines prawy

Kod
<div class="kwadrat" style="display: block; width: 16px; height: 16px; float: left; margin-right: 8px; background: green;">&nbsp;</div><span style="float: left;">Kwadrat</span>


Pamiętaj, inline-styles są złem i użyj do tego arkuszy CSS. To jest tylko przykład na szybko.


--------------------
Go to the top of the page
+Quote Post
rocktech.pl
post 9.05.2012, 08:20:46
Post #3





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

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


Witam.

  1. .kwadrat:before {
  2. content:"\25A0";
  3. color: orange;
  4. font-size:1.50em;
  5. }


  1. <span class="kwadrat">Dyskusja</span>


Ten post edytował rocktech.pl 9.05.2012, 12:11:41


--------------------
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
r4xz
post 9.05.2012, 15:29:28
Post #4





Grupa: Zarejestrowani
Postów: 673
Pomógł: 106
Dołączył: 31.12.2008

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


lub też kombinacja padding-left z border-left (tylko trzeba ostrożnie - nastąpi zmiana wysokości i mamy prostokąt wink.gif )


--------------------
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 Wersja Lo-Fi Aktualny czas: 12.06.2025 - 21:44