HTML, CSS and anything else that deals with client side capabilities.
Moderator: General Moderators
Sindarin
Forum Regular
Posts: 521 Joined: Tue Sep 25, 2007 8:36 am
Location: Greece
Post
by Sindarin » Mon Jun 01, 2009 8:59 am
Code: Select all
<div>
<div style="position:relative;left:0px;top:0px;width:32px;background:red;">test</div><div style="position:relative;left:55px;top:0px;width:32px;">test</div>
</div>
It should be displaying as
not
I tried every possible combination with my external stylesheets unlinked as well. What's going on?
kaszu
Forum Regular
Posts: 749 Joined: Wed Jul 19, 2006 7:29 am
Post
by kaszu » Mon Jun 01, 2009 11:41 am
Setting top, left, right, bottom for 'relative' position element doesn't puts it at the top, left, right or bottom, but it acts similar to margin. You should use floats or set position to absolute.
iFlex
Forum Commoner
Posts: 41 Joined: Sat May 30, 2009 3:44 am
Post
by iFlex » Mon Jun 01, 2009 1:02 pm
kaszu wrote: Setting top, left, right, bottom for 'relative' position element doesn't puts it at the top, left, right or bottom, but it acts similar to margin. You should use floats or set position to absolute.
I was just about to mention position absoute!
pickle
Briney Mod
Posts: 6445 Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:
Post
by pickle » Mon Jun 01, 2009 2:09 pm
You could try floating the first div too.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
ofir0803
Forum Newbie
Posts: 22 Joined: Sun Jan 18, 2009 3:03 pm
Post
by ofir0803 » Wed Jun 17, 2009 9:31 am
or u can do this...
Code: Select all
<div style="width:64px;">
<div style="float:right;width:32px;background:red;">test</div>
<div style="float:left;width:32px;">test</div>
</div>
Sindarin
Forum Regular
Posts: 521 Joined: Tue Sep 25, 2007 8:36 am
Location: Greece
Post
by Sindarin » Thu Jun 18, 2009 4:10 am
Thanks it worked now.