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
Something I expected to be easy
Old 03-08-2009, 03:49 PM Something I expected to be easy
pealo86's Avatar
Super Spam Talker

Posts: 876
Name: Matt Pealing
Location: England, north west
Trades: 0
Im trying to get a div so that it is always 15px in from the left of the page, but for it to take up the rest of the remaining page no matter what the useres resolution is.

So far I have this code:
Code:
#portalWrapper {
    position:absolute;
    width:100%;
    padding-left:15px;
    background-color:#FFF;
    height:200px;
    z-index:1; }

#test {
    background:#000; }
Code:
<div id="portalWrapper">
<div id="test">aasdfsadf</div>
</div>

This makes div#test shift to the left by 15px, however it's width remains the full width of the browser and therefore a horizontal scroll bar is inserted into the page.

Instead of shifting div#test to the side, I sort of want to 'squeeze' it by 15px, am I on the right track to getting it right or do I need a completely different method?
__________________

Please login or register to view this content. Registration is FREE

Last edited by pealo86; 03-08-2009 at 03:50 PM..
pealo86 is offline
Reply With Quote
View Public Profile Visit pealo86's homepage!
 
 
Register now for full access!
Old 03-08-2009, 06:48 PM Re: Something I expected to be easy
stevej's Avatar
Professional Multitasker

Posts: 996
Location: Not positive
Trades: 0
You're on the right track, but you have a lot of unnecessary CSS in there that's causing you problems.

First off, here is some code you should be using instead:
Code:
#portalWrapper {
    padding-left:15px;
    background-color:#FFF;
    height:200px;
}

#test {
    background:#000; 
}
What I did was take out the positioning, the width, and the z-index. Unless you have a specific reason to have the positioning or the z-index in there, they're just cluttering up your code. The positioning also oftentimes clutters up your layout. I got rid of the width because the width for divs on browsers is automatically the width of the browser window. So that's not needed either. Try out that code, it outta work. If not, tell me.

- Steve
__________________
if($stevej == "helpful") { $talkupation += $user_power; }
stevej is offline
Reply With Quote
View Public Profile
 
Old 03-09-2009, 02:34 PM Re: Something I expected to be easy
pealo86's Avatar
Super Spam Talker

Posts: 876
Name: Matt Pealing
Location: England, north west
Trades: 0
Ahh thanks that seems to work. I had a lot of other code in there because I was originally messing around getting everything positioned absolutely, but I don't think I need to bother with any of that anymore!
__________________

Please login or register to view this content. Registration is FREE
pealo86 is offline
Reply With Quote
View Public Profile Visit pealo86's homepage!
 
Reply     « Reply to Something I expected to be easy
 

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 1.90966 seconds with 12 queries