Forum FAQForum FAQSearchSearch MemberlistMemberlist Forum ignore listForum ignore list RegisterRegister ProfileProfile Log in to check your private messagesLog in to check your private messages Log inLog in
Vertikalno centriranje diva

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    mi3dot.org Forum Index -> Client-side
View previous topic :: View next topic  
Author Message
Tristan



Joined: 01 Aug 2006
Posts: 614
Location: Under the sky

PostPosted: 06.12.2008 18:30    Post subject: Vertikalno centriranje diva Add user to your forum ignore list Reply with quote

Vaša najbolja metoda za vertikalno centriranje nekog diva (najčešće wrappera) je?

_________________
Carpe diem...
Back to top
View user's profile Send private message Visit poster's website
maratz
mi3.crew


Joined: 24 Nov 2003
Posts: 1207
Location: ZAG

PostPosted: 06.12.2008 18:38    Post subject: Add user to your forum ignore list Reply with quote

fiksne dimenzije:
position absolute + top 50% + negativna gornja margina u iznosu pola visine

promjenjiva visina:
display: table-cell + vertical-align: middle

Mislim da to mora biti ovdje negdje: http://www.mi3dot.org/forum/viewtopic.php?t=3888

_________________
STOP HITTING YOURSELF! | NETIQUETTE | TYPETESTER | Hypertext rulez™ | CREATIVE NIGHTS | ACCOMMODATIONS
Back to top
View user's profile Send private message Visit poster's website Twitter profile
base



Joined: 12 Jul 2007
Posts: 96

PostPosted: 06.12.2008 19:09    Post subject: Add user to your forum ignore list Reply with quote

Quote:
margin:0 auto;

nebi bilo dobro rješenje?
Back to top
View user's profile Send private message
dr_Hate



Joined: 28 Aug 2007
Posts: 168
Location: Rijeka

PostPosted: 06.12.2008 19:28    Post subject: Add user to your forum ignore list Reply with quote

za horizontalno da, za vertikalno ne jer ga lijepi na vrh Wink

_________________
imam domenu |stajduhar.org|
Back to top
View user's profile Send private message Visit poster's website
mile



Joined: 10 Sep 2003
Posts: 1327
Location: Jeruzalem

PostPosted: 06.12.2008 20:43    Post subject: Add user to your forum ignore list Reply with quote

dr_Hate wrote:
za horizontalno da, za vertikalno ne jer ga lijepi na vrh Wink

Ali ako okreneš monitor na bok, onda radi.

_________________
mile.is
Back to top
View user's profile Send private message Visit poster's website
segen



Joined: 19 Dec 2006
Posts: 671
Location: ZG <-> ST

PostPosted: 06.12.2008 21:06    Post subject: Add user to your forum ignore list Reply with quote

mile wrote:
dr_Hate wrote:
za horizontalno da, za vertikalno ne jer ga lijepi na vrh Wink

Ali ako okreneš monitor na bok, onda radi.


HAHAHAHAHAHAHHAA

_________________
NEW ∞folija∞ Follow me
Ovaj svijet je samo varka!
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger Twitter profile
nel`chee



Joined: 08 Jul 2004
Posts: 2087
Location: Rijeka

PostPosted: 06.12.2008 21:19    Post subject: Add user to your forum ignore list Reply with quote

mile wrote:
dr_Hate wrote:
za horizontalno da, za vertikalno ne jer ga lijepi na vrh Wink

Ali ako okreneš monitor na bok, onda radi.

sad znam tko mi je najviše falio na forumu Laughing

_________________
art & design portfoliofree Photoshop brushes stuffsketchblogfacebook
Back to top
View user's profile Send private message Visit poster's website Twitter profile
mile



Joined: 10 Sep 2003
Posts: 1327
Location: Jeruzalem

PostPosted: 06.12.2008 21:37    Post subject: Add user to your forum ignore list Reply with quote

nel`chee wrote:

sad znam tko mi je najviše falio na forumu Laughing

thanks, valjda.. Smile

_________________
mile.is
Back to top
View user's profile Send private message Visit poster's website
PaNtHeR



Joined: 17 Sep 2003
Posts: 161

PostPosted: 07.12.2008 20:54    Post subject: Add user to your forum ignore list Reply with quote

Maratz jel bi ovo trebalo radit?

Code:
<div style="display:table-cell; vertical-align:middle">
<div style="background-color:#CCC; width: 500px">
 <p> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris consectetur quam sed urna. Nulla facilisi. Vestibulum adipiscing sem nec nibh. Duis adipiscing semper nunc. Aliquam varius tincidunt... </p>
</div>
</div>


Znam da nisam nikad pronašao neko jednostavno rješenje, ali probavam sad ovo pa ne radi, mozda sam nešto fulao...

Ovo radi unutar nekog diva, ali mislim da je Tristan pitao za centriranje unutar prozora...

_________________
Back to top
View user's profile Send private message Send e-mail
maratz
mi3.crew


Joined: 24 Nov 2003
Posts: 1207
Location: ZAG

PostPosted: 07.12.2008 22:53    Post subject: Add user to your forum ignore list Reply with quote

PaNtHeR wrote:
Znam da nisam nikad pronašao neko jednostavno rješenje, ali probavam sad ovo pa ne radi, mozda sam nešto fulao...

Ovo radi unutar nekog diva, ali mislim da je Tristan pitao za centriranje unutar prozora...


body/div svejedno koji je display: table-cell. U ovom tvom primjeru nedostaje visina koja se
u svakom slučaju mora zadati. Fora kod "apsolutnog" načina je da ti za negativnu marginu
treba točna visina, podjeljena sa dva. Ako radiš s postocima, to je nemoguće dobiti u CSS-u.

korisni linkovi:
http://d-graff.de/fricca/center.html
http://www.webmasterworld.com/css/3350566.htm

_________________
STOP HITTING YOURSELF! | NETIQUETTE | TYPETESTER | Hypertext rulez™ | CREATIVE NIGHTS | ACCOMMODATIONS
Back to top
View user's profile Send private message Visit poster's website Twitter profile
PaNtHeR



Joined: 17 Sep 2003
Posts: 161

PostPosted: 08.12.2008 08:39    Post subject: Add user to your forum ignore list Reply with quote

Da, da ova "apsolutna" metoda mi je sasvim jasna i radi odlično. Samo sam htio provjerit da li ova druga metoda koju si spomenuo radi jer da radi bilo bi to super, ali kao što si rekao to je nemoguće pomoću CSSa dobit, treba i JS.

Zbunilo me ovo: "promjenjiva visina" Shocked

_________________
Back to top
View user's profile Send private message Send e-mail
maratz
mi3.crew


Joined: 24 Nov 2003
Posts: 1207
Location: ZAG

PostPosted: 08.12.2008 10:37    Post subject: Add user to your forum ignore list Reply with quote

PaNtHeR wrote:
Zbunilo me ovo: "promjenjiva visina" Shocked


Odnosno height: 100%

_________________
STOP HITTING YOURSELF! | NETIQUETTE | TYPETESTER | Hypertext rulez™ | CREATIVE NIGHTS | ACCOMMODATIONS
Back to top
View user's profile Send private message Visit poster's website Twitter profile
clown



Joined: 19 Oct 2004
Posts: 181
Location: Brestovac DC

PostPosted: 08.12.2008 11:27    Post subject: Add user to your forum ignore list Reply with quote

maratz wrote:
PaNtHeR wrote:
Zbunilo me ovo: "promjenjiva visina" Shocked


Odnosno height: 100%


ni meni ne radi, molim neki primjer... tnx
Back to top
View user's profile Send private message
maratz
mi3.crew


Joined: 24 Nov 2003
Posts: 1207
Location: ZAG

PostPosted: 08.12.2008 13:54    Post subject: Add user to your forum ignore list Reply with quote

clown wrote:
maratz wrote:
PaNtHeR wrote:
Zbunilo me ovo: "promjenjiva visina" Shocked


Odnosno height: 100%


ni meni ne radi, molim neki primjer... tnx

prije navedeni linkovi

_________________
STOP HITTING YOURSELF! | NETIQUETTE | TYPETESTER | Hypertext rulez™ | CREATIVE NIGHTS | ACCOMMODATIONS
Back to top
View user's profile Send private message Visit poster's website Twitter profile
PaNtHeR



Joined: 17 Sep 2003
Posts: 161

PostPosted: 08.12.2008 16:55    Post subject: Add user to your forum ignore list Reply with quote

Mislim da ovo treba stat, ne želim flejmat, samo mi nije jasna ova metoda:

Quote:
promjenjiva visina:
display: table-cell + vertical-align: middle


iz ovoga se da naslutiti da pomoću ovoga možeš vertikalno centrirati div kojemu neznaš visinu i to unutar body-ja kojemu također neznaš visinu ... Jesam li u pravu?

ovaj link: http://d-graff.de/fricca/center.html prikazuje neku totalno trinaestu metodu,
a ovaj: http://www.webmasterworld.com/css/3350566.htm mi se ne da niti čitat Razz

U svakom slučaju Maratz hvala jer ona "absolute" metoda šljaka i to odlično...

_________________
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    mi3dot.org Forum Index -> Client-side All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group