...

View Full Version : floating div clings to side of browser/moves with browser when resizing



OctopusSandwich
08-08-2011, 09:17 AM
http://www.octopussandwich.com/


.account {
background: #333333;
max-width: 230px;
min-width: 230px;
border: 6px black solid;
border-radius: 10px;
float: right;
}

That's my website and below it is the code for the floating div. See on my website if you restore down/resize your browser the floating div will move with it. Does anybody know how to fix it? :(

Avril
08-08-2011, 02:47 PM
You have floated the .account div to the right in the css, and tried to centre it in the html. That might be the problem...

OctopusSandwich
08-08-2011, 05:45 PM
You have floated the .account div to the right in the css, and tried to centre it in the html. That might be the problem...
It didn't fix it. Thanks anyway!

OctopusSandwich
08-09-2011, 10:20 PM
Anybody?

vikram1vicky
08-10-2011, 12:19 PM
http://www.octopussandwich.com/


.account {
background: #333333;
max-width: 230px;
min-width: 230px;
border: 6px black solid;
border-radius: 10px;
float: right;
}That's my website and below it is the code for the floating div. See on my website if you restore down/resize your browser the floating div will move with it. Does anybody know how to fix it? :(


Why you set min and max width with same value???

If you don't width more or less than 230px, you can simply use width:230px; property.

:)

Avril
08-10-2011, 12:52 PM
Do you wish to centre the .account div? if so you should centre it in the window with:

margin: 0 auto;

Or have I missed something here?

alykins
08-10-2011, 11:41 PM
Do you wish to centre the .account div? if so you should centre it in the window with:

margin: 0 auto;

Or have I missed something here?

@OP... is this what you are attempting? If not please clarify. If you need to take a screen shot and edit in paint so we can see what you are attempting



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum