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
Need help on my style sheet
Old 10-29-2006, 03:40 AM Need help on my style sheet
Extreme Talker

Posts: 217
Trades: 0
Im making a site template, but iv never made one before (Well once but it sucked) and im currently making my first style sheet.. anyhow i have this messed up problem. il show you my code first:

CSS:
Code:
#contentbg {
    width: 700px;
    float: left;
    background: url(images/contentbg.jpg);
    margin-left: 20px;

}
#contenttop{
    width: 700px;
    float: left;
    height: 18px;
    background: url(images/contenttop.jpg);
    margin-left: 20px;
}
#contentbottom{
    width: 700px;
    float: left;
    height: 18px;
    background: url(images/contentbottom.jpg);    
    margin-left: 20px;
}
#content{
    width: 650px;
    float: left;
    margin-left: 20px;
    padding-left: 5px;
}
Template code (the part causing problems):
Code:
<div id="contenttop">
</div>
<div id="contentbg">
    <div id="content">
    **content goes here**
   </div>
</div>
<div id="contentbottom">
</div>




<p>
<center>
<font size="1"><a href="index.php?module=about">About</a> :: <a href="index.php?module=staff">Staff</a> :: <a href="index.php?module=contact">Contact</a> :: <a href="index.php?module=jobs">Jobs</a></font>
</center>
Basicly whats happening is when i have the float: left; on my style sheet its pushing the footer onto the top right of the page (the stuff with links to staff, about etc.). when i take the float off everything looks ok...except that there is a weird gap between my bottom div and the one above it. Iv been trying to figure this our for a few hours now and nothing works! Help will be greatly apreciated.
Slick Nick is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 10-29-2006, 07:00 AM Re: Need help on my style sheet
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,371
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Rather difficult to know which is the one with "(the stuff with links to staff, about etc.). "


get rid of the deprecated <center> and <font> stuff for a start

to centre a container use a fixed width and margin:npx auto;

to stop the footer (whichever one it is) "floating" to the side you need to "break" the float by adding a clear:right or clear:both to the footer div.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 10-29-2006, 01:04 PM Re: Need help on my style sheet
Extreme Talker

Posts: 217
Trades: 0
Alright thanks, it worked

now I have another problem though. I have a sidebar im trying to put on the page, but some more weird stuff is happening: (screenshot) http://www.ncrusaders.com/random/error.jpg

here is the css that defines it:
Code:
#sidebarbg{
    width: 131px;
    float: right;
    clear: left;
    background: url(images/sidebarbg.jpg);

}
#sidebartop{
    width: 131px;
    float: right;
    clear: left;
    height: 20px;
    background: url(images/sidebartop.jpg);

}
#sidebarbottom{
    width: 131px;
    float: right;
    clear: left;
    height: 20px;
    background: url(images/sidebarbottom.jpg);

}
and the html...

Code:
<div id="sidebartop">
</div>
<div id="sidebarbg">
test
</div>
<div id="sidebarbottom">
</div>
Slick Nick is offline
Reply With Quote
View Public Profile
 
Old 10-29-2006, 05:19 PM Re: Need help on my style sheet
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,371
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
again it's hard to say exactly without seeing the actual page and the entire code, but when you float something right and clear the left side of the same element the chances of success are fairly slim.

At a guess creating a container sized to hold all three elements and floating that one right should give the effect I assume you are trying to achieve
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 10-29-2006, 05:37 PM Re: Need help on my style sheet
Extreme Talker

Posts: 217
Trades: 0
Yay! Finaly all my problems have been solved today thanks a ton
Slick Nick is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Need help on my style sheet
 

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