• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

HTML positioning

JoccE

CopyLeft (ɔ)
Joined
Aug 26, 2007
Messages
3,418
Solutions
1
Reaction score
92
Location
Sweden, Stockholm
So i got kind of a noobish question :D

I'm building a template in HTML and i have a content div to the left and 3 menu boxes to the left using:

PHP:
	float: right;
and

PHP:
	float: left;

But if there is no text in the left content box the small boxes moves auto a bit to the left.

How can i solve this position problem? :p

//JoccE
 
You mean if the left box doesnt have any content so does the right box go to the left. is this what you mean and how you can stop that from happening?
 
tried to set a witdh and a height to both elements so they are not dynamic?
maybe you need but if you are using it on a div that doesnt have a changed display value it should work
Code:
display:block;
 
you are floating. if you float and there is no content the discription of any other div will take place in this fact its the standart form which will cause tham to move, you could try to make a id with what xon already said display:block; or just dont implent div's without content o.o :D
 
you are floating. if you float and there is no content the discription of any other div will take place in this fact its the standart form which will cause tham to move, you could try to make a id with what xon already said display:block; or just dont implent div's without content o.o :D

Can't use display:block;.

Then the menu content is placed under the content not to the right
 
Code:
#1
position: relative;
top: 20px
left: 20px
Code:
#2
position: relative;
top: 20px
right: 20px

But your content need a absolute position else they will get into the corner on your screen
 
Yeh i have everything inside a div that centers it.

Problem now is that
Sure the menu is to the right of the content but it is still under it

Check out: Template

- - - Updated - - -

Solved it using

min-height: XXpx;
 
Back
Top