tutoriale photoshop, brushes, patterns, gradient
Site afiliat proiectului Wtricks.com
   
   
  REGULAMENT | Search | Members | Calendar | Help  
 


Post Reply  Post Thread 
div style
Author Message
ctlinf
De al casei
***


Posts: 75
Group: Registered
Joined: Aug 2008
Status: Offline
Reputation: 0
Lei: 377.9
Post: #1
div style

Astazi am codat un template, totul bun dar la sfarsit am vazut ca nu era centrat asa cum am vrut.
Am codul:

Code:
<div style="position:absolute; left:157px; top:52px; width:802px; height:174px;"><img src="imagini/banner.png" alt="Banner sitename" width="800" height="172" style="border:#000000 1px solid"/></div>

Am incercat:

Code:
<div style="position:absolute; top:52px; width:802px; height:174px;"><center><img src="imagini/banner.png" alt="Banner sitename" width="800" height="172" style="border:#000000 1px solid"/></center></div>

09-22-2008 12:30 AM
Find all posts by this user Quote this message in a reply
Mihai_Only
Moderator
*****


Posts: 396
Group: Moderators
Joined: Jul 2007
Status: Offline
Reputation: 1
Lei: 1210.99
Post: #2
RE: div style

De obicei pentru centrare se foloseşte "margin:0px auto;"

09-22-2008 01:53 AM
Visit this users website Find all posts by this user Quote this message in a reply
ctlinf
De al casei
***


Posts: 75
Group: Registered
Joined: Aug 2008
Status: Offline
Reputation: 0
Lei: 377.9
Post: #3
RE: div style

Code:
<div style="margin:0px auto; position:absolute; left:157px; top:52px; width:802px; height:174px;"><img src="imagini/banner.png" alt="Banner sitename" width="800" height="172" style="border:#000000 1px solid"/></div>

Daca te referi la asta nu merge.

09-22-2008 07:15 AM
Find all posts by this user Quote this message in a reply
Overdeath
Membru
**


Posts: 31
Group: Registered
Joined: Sep 2008
Status: Offline
Reputation: 0
Lei: 108.3
Post: #4
RE: div style

Ai incercat asa?

Code:
<div style="position:absolute; left:157px; top:52px; width:802px; height:174px;"><img src="imagini/banner.png" alt="Banner sitename" width="800" height="172" style="margin:0px auto; border:#000000 1px solid"/></div>

Desi vad ca imaginea are 800*172 si divul 802*174, asta inseamna ca nu prea are cum sa nu fie aliniata la mijloc. Un screenshot ar fi edificator. Eu nu prea imi dau seama care e problema.


My Blog
09-22-2008 06:58 PM
Visit this users website Find all posts by this user Quote this message in a reply
Mihai_Only
Moderator
*****


Posts: 396
Group: Moderators
Joined: Jul 2007
Status: Offline
Reputation: 1
Lei: 1210.99
Post: #5
RE: div style

ctlinf Wrote:

Code:
<div style="margin:0px auto; position:absolute; left:157px; top:52px; width:802px; height:174px;"><img src="imagini/banner.png" alt="Banner sitename" width="800" height="172" style="border:#000000 1px solid"/></div>

Daca te referi la asta nu merge.

Mă refer la margine numai...Nu mai pune şi position şi left şi top ci lasă-le doar pe cele 3.

09-22-2008 10:42 PM
Visit this users website Find all posts by this user Quote this message in a reply
DarK4EveR
Super Moderator
******


Posts: 707
Group: Super Moderators
Joined: Aug 2007
Status: Offline
Reputation: 12
Lei: 2761.89
Post: #6
RE: div style

cand ii dai "position:absolute" si apoi ii dai left:157px; si top:52px, layerul respectiv va sta pentru totdeauna la exact 157 pixeli de marginea stanga a browserului si la 52 pixeli de marginea superioara a browserului, indiferent de ce rezolutie ai.

Concluzie? Foloseste "absolute" doar atunci cand chiar ai nevoie de el ( ex, sa fac un banner care sa stea mereu in colt dreapta jos si sa se plimbe oricat de mult ai da scroll, el sa-si pastreze locul, sau un formular de login, sau un cos de cumparaturi, etc. ). Altfel ocoleste "absolute" deoarece nu se va centra in veci!


Adrian Sandu
Administrator IT
AdrianSWebS.CoM - Pseudo Blogging
09-23-2008 03:41 AM
Visit this users website Find all posts by this user Quote this message in a reply
ctlinf
De al casei
***


Posts: 75
Group: Registered
Joined: Aug 2008
Status: Offline
Reputation: 0
Lei: 377.9
Post: #7
RE: div style

Deci daca folosesc codul:

Code:
<div style="margin:0px auto; width:802px; height:174px;"><a href="index.html"><img src="imagini/banner.png" alt="Banner sitename" width="800" height="172" style="border:#000000 1px solid"/></a></div>

bannerul se duce pe centru, e ok, doar ca eu am nevoie si de top:157px

Imi puteti genera un cod corect ?

09-23-2008 05:44 AM
Find all posts by this user Quote this message in a reply
Sebi M
De al casei
***


Posts: 57
Group: Registered
Joined: Sep 2008
Status: Offline
Reputation: 0
Lei: 155.5
Post: #8
RE: div style

incearca un position:relative xxx px; fata de elementul din fata bannerului


http://www.Gww.ro  ||  http://www.DirectorWebRomanesc.ro
09-23-2008 06:07 AM
Visit this users website Find all posts by this user Quote this message in a reply
Mihai_Only
Moderator
*****


Posts: 396
Group: Moderators
Joined: Jul 2007
Status: Offline
Reputation: 1
Lei: 1210.99
Post: #9
RE: div style

Se rezolvă tot cu proprietatea margin .

Code:
margin:157px auto 0px auto;

09-24-2008 02:50 AM
Visit this users website Find all posts by this user Quote this message in a reply
ctlinf
De al casei
***


Posts: 75
Group: Registered
Joined: Aug 2008
Status: Offline
Reputation: 0
Lei: 377.9
Post: #10
RE: div style

Am rezolvat cu codul lui Mihai, multumesc mult !

09-24-2008 06:21 AM
Find all posts by this user Quote this message in a reply
Post Reply  Post Thread 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Paron phpBB 3.0.2 style Muzet 4 106 08-10-2008 10:35 PM
Last Post: Muzet

View a Printable Version
Send this Thread to a Friend
Subscribe to this Thread | Add Thread to Favorites

Forum Jump:

 

 Invatam Net
Esti nou pe aici? Vorbeste-ne despre tine.
Citeste articole si tutoriale unice.
Ai un site? Iti putem oferi un review.

  Parteneri

  


-->