Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
Old 05-17-2006, 07:58 PM Center and expand
rab
Average Talker

Posts: 21
Trades: 0
Can someone help me center and make this site expandable?
http://rabrab.no-ip.org:8080/ss/

I've tried but I cant get both, and I had to use absolute positioning, or it would look weird in IE6
rab is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 05-18-2006, 02:09 AM Re: Center and expand
vangogh's Avatar
Post Impressionist

Posts: 10,688
Name: Steven Bradley
Location: Boulder, Colorado
Trades: 0
rab I'm not 100% sure about you mean by expandable, but I'm assuming you want the left side to expand to meet the height of the main content area.

What I would do is wrap all of your code in a container div with an id of container. Then the css to center it would be:

div#container {width:800px; margin:0 auto}

That will center your page. I think you used 800px as your width. I'd suggest a little less if you're trying to get the page to work at 800x600 resolution. I usually use 760px, but some people go as high as 780px.

Then to get the left side to expand down you can actually apply a little trick. Give the same container div a background color that's the same as you left side, so:

div#container {background-color:#619af3}

The left side really won't be expanding but it will look like it has. You may need to set the white background on the page div. The white border you have will probably need to be moved to the new container div as well.
__________________
l Search Engine Friendly Web Design |
Please login or register to view this content. Registration is FREE

l Tips On Marketing, SEO, Design, and Development |
Please login or register to view this content. Registration is FREE

l
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
vangogh is offline
Reply With Quote
View Public Profile Visit vangogh's homepage!
 
Old 05-18-2006, 12:41 PM Re: Center and expand
rab
Average Talker

Posts: 21
Trades: 0
Thanks, its centered but the left side still wont expand
rab is offline
Reply With Quote
View Public Profile
 
Old 05-18-2006, 03:44 PM Re: Center and expand
vangogh's Avatar
Post Impressionist

Posts: 10,688
Name: Steven Bradley
Location: Boulder, Colorado
Trades: 0
rab I see the problem. What's going on is that when you've used postioning on the elements you've taken them out of the normal document flow. What that means is that the container divs aren't expanding where you think they will since what's inside of them has actually been removed for the flow.

I played around with some of the css and got things to basically work. There's still a few details to get working better, but this should give you the overall structure you want.

HTML Code:
body {
    background: #0433A2;
    color: #000000;
    padding-top: 15px;
    padding-bottom: 5px;
}
div#container {
    width:800px;
    margin: 0 auto;
    background-color: #6A9AF3;
}
div.main {
    background: #FBFBFB;
    color: #000000;
    border: solid;
    border-color: #FFFFFF;
    border-width: 1px;
    width: 800px;
    background-color: #6A9AF3;

}
div.header {
    background: #6A9AF3;
    text-align: right;
}
div.side_module {
    background: #6A9AF3;
    color: #FFFFFF;
    padding: 3px;
    width: 200px;
    top: 120px;
    position: absolute;
    border-right: solid;
    border-right-color: #475CF0;
    border-right-width: 1px;
}
a.navagation {
    background: #6A9AF3;
    color: #FFFFFF;
    padding-left: 3px;
    text-align: left;
    text-decoration: none;
}
a.navagation:hover {
    background: #6A9AF3;
    color: #000000;
    padding-left: 13px;
    text-align: left;
    text-decoration: none;
}
div.page {
    text-align: left;
    background: #FBFBFB;
    color: #000000;
    border-top: solid;
    border-top-color: #475CF0;
    border-top-width: 1px;
    width: 588px;
    padding-top: 20px;
    padding-left: 5px;
    margin-left:207px;
}
div.space {
    margin: 5px;
    text-align: center;
    height: 10px;
    widows: 100%;
    background: #FBFBFB;
    
}
div.login {
    text-align: center;
}
span.landr {
    font-size: 11px;
}
div.info {
    font-size: 12px;
}
div.copyright {
    font-size: 12px;
}
div.news_head {
    background: #475CF0;
    border: solid;
    border-color: #6A9AF3;
    border-width: 1px;
    width: 500px;
    height: 20px;
    margin-bottom: 3px;
    margin-top: 10px;
    text-align: center;
    margin-left: 47px;
    margin-right: 47px;
}
div.news_text {
    background: #FBFBFB;
    color: #000000;
    width: 450px;
    margin-left: 72px;
    margin-right: 72px;
}
Hope it helps.
__________________
l Search Engine Friendly Web Design |
Please login or register to view this content. Registration is FREE

l Tips On Marketing, SEO, Design, and Development |
Please login or register to view this content. Registration is FREE

l
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
vangogh is offline
Reply With Quote
View Public Profile Visit vangogh's homepage!
 
Old 05-26-2006, 11:31 AM Re: Center and expand
Average Talker

Posts: 19
Trades: 0
just wanted to say thank you i was having trouble centering my page in firefox and your centering trick did it! yay!
thanks again!

Last edited by emagine; 05-27-2006 at 02:41 PM..
emagine is offline
Reply With Quote
View Public Profile
 
Old 05-26-2006, 02:18 PM Re: Center and expand
vangogh's Avatar
Post Impressionist

Posts: 10,688
Name: Steven Bradley
Location: Boulder, Colorado
Trades: 0
Glad I could help
__________________
l Search Engine Friendly Web Design |
Please login or register to view this content. Registration is FREE

l Tips On Marketing, SEO, Design, and Development |
Please login or register to view this content. Registration is FREE

l
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
vangogh is offline
Reply With Quote
View Public Profile Visit vangogh's homepage!
 
Reply     « Reply to Center and expand
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.17692 seconds with 12 queries