9 replies [Last post]
wiklander
Offline
newbie
Last seen: 10 years 18 weeks ago
Timezone: GMT+1
Joined: 2010-03-05
Posts: 5
Points: 6

Hi

Felleing like a big rookie at this time. Got the ide to create a page with divs centered on the page, the left and right should be auto height and width, the main div size is width fixed size but height auto.

how in gods name can I get the 3 to be centered and left and right auto height and width,. please help

/Wiklander

tx for help...

Verschwindende
Verschwindende's picture
Offline
Guru
Last seen: 3 weeks 5 days ago
Timezone: GMT-4
Joined: 2009-10-09
Posts: 2043
Points: 2268

the blue line represents a

the blue line represents a wrapper to whose definition you will add margin: 0 auto; then for equal height columns use the faux columns technique.

Will the left and right columns contain anything beyond a background image.

wiklander
Offline
newbie
Last seen: 10 years 18 weeks ago
Timezone: GMT+1
Joined: 2010-03-05
Posts: 5
Points: 6

the problem is that the blu

the problem is that the blu wrapper cant have a fixed width since left and right has auto width and can grow.
left and right will contain webuser controlls with info/advertice/or nothing

My wrapper when I set auto seams to take the whole page and wont place itself in the center.

Verschwindende
Verschwindende's picture
Offline
Guru
Last seen: 3 weeks 5 days ago
Timezone: GMT-4
Joined: 2009-10-09
Posts: 2043
Points: 2268

wiklander wrote:the problem

wiklander wrote:

the problem is that the blu wrapper cant have a fixed width since left and right has auto width and can grow.

What you're saying isn't jiving with the image. I'm not sure I understand what you're after.

Show your current code. Maybe it will make sense.

wiklander
Offline
newbie
Last seen: 10 years 18 weeks ago
Timezone: GMT+1
Joined: 2010-03-05
Posts: 5
Points: 6

html: <div id="wrap">  

html:

    <div id="wrap">
 
        <div id="left">
        Left
        </div>
 
        <div id="main">
        <asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">
        Main
        </asp:ContentPlaceHolder> 
        </div>
 
        <div id="right">
        Right
        </div>        
 
 
    </div>

CSS:

#wrap {margin: 0 auto;}
 
#left {width:auto; height:auto; float:left;}
 
#main {width:900px; height:900px; float:left; background-color:Black;}
 
#right {width:auto; height:auto; float:left;}

not sure I done it right, at this point I am in doubt on everything regarding html Big smile

Verschwindende
Verschwindende's picture
Offline
Guru
Last seen: 3 weeks 5 days ago
Timezone: GMT-4
Joined: 2009-10-09
Posts: 2043
Points: 2268

wiklander wrote: #wrap

wiklander wrote:

#wrap {margin: 0 auto;}

If you're not defining a width for #wrap it will fill the available browser width (all of it). How wide do you want #wrap to be?

wiklander
Offline
newbie
Last seen: 10 years 18 weeks ago
Timezone: GMT+1
Joined: 2010-03-05
Posts: 5
Points: 6

so what you say is that what

so what you say is that what I want don can't be done.
If I set a size on the wrapper it wont be able to grow with the left and the right div's width.

Verschwindende
Verschwindende's picture
Offline
Guru
Last seen: 3 weeks 5 days ago
Timezone: GMT-4
Joined: 2009-10-09
Posts: 2043
Points: 2268

wiklander wrote:so what you

wiklander wrote:

so what you say is that what I want don can't be done. ...

I can't say because I'm not exactly sure that I understand what you want.

Are you sure you want #left and #right to be auto sized? Does that make sense?

CupidsToejam
CupidsToejam's picture
Offline
Guru
Florida
Last seen: 4 years 43 weeks ago
Florida
Timezone: GMT-4
Joined: 2008-08-15
Posts: 2637
Points: 1556

this might help. I too, have

this might help. I too, have no idea what you need, as I cant see the image. Must be hosted on Imageshack.

http://blog.html.it/layoutgala/

wiklander
Offline
newbie
Last seen: 10 years 18 weeks ago
Timezone: GMT+1
Joined: 2010-03-05
Posts: 5
Points: 6

yes, My plan was to have the

yes, My plan was to have the left and right div Auto width. I am gona use this template for several pages, som pages gona fill the left and right div with advertice and info. If there are no info I would like the divs to take no space.

If the left div is empty I dont want it to take any space on the page, thats the general thought.

/Wiklander