Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Wyśrodkowane 2 divy koło siebie
creative123
post
Post #1





Grupa: Zarejestrowani
Postów: 16
Pomógł: 0
Dołączył: 20.01.2010

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


Mam 2 divy:

  1. <div>
  2. <div class="button"><a href="coś">Napis</a></div>
  3. <div class="button"><a href="coś2">Napis2</a></div>
  4. </div>


Jak umieścić je koło siebie, aby jednocześnie były wyśrodkowane?
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
icetique
post
Post #2





Grupa: Zarejestrowani
Postów: 72
Pomógł: 13
Dołączył: 12.04.2009

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


Kod
<div style="margin: 0px auto; width: 500px;"> // ważne, żeby ustalić szerokość, jeśli masz niestałą szerokość, to dodaj display: inline-block;, w przeciwnym wypadku div zajmie całą stronę (w szerokości).
  <div class="button" style="float: left;"><a href="coś">Napis</a></div>
  <div class="button" style="float: left;"><a href="coś2">Napis2</a></div>
<br style="clear: both;" />
  </div>


Ten post edytował icetique 31.01.2010, 22:00:10
Go to the top of the page
+Quote Post

Posty w temacie


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: 10.06.2026 - 13:46