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 06-02-2010, 06:18 PM Help fixing my CSS
Skilled Talker

Posts: 53
Trades: 0
So Im starting to learn some CSS but I'm having trouble rendering my page layout the way I want it to in firefox (page looks as it is supposed to in internet explorer) This is the CSS where I'm having trouble...
HTML Code:
body {
    margin: 0px;
    padding: 0px;
    font-family: Calibri, Arial, Tahoma;
}

#content {
    width: 100%;
    margin: 0px auto 0px auto;
    border: 1px solid #000;
    clear: both;
    height: 1000px;
}

.article {
    width: 80%;
    float: left;
    margin: 0px auto 0px auto;
    border: 1px solid #000;
    clear: both;
    height: 1000px;
}

.sidebar {
    width: 20%;
    float: right;
    margin: 0px auto 0px auto;
    border: 1px solid #000;
    clear: both;
    height: 1000px;
}
Now what I'm trying to do is have some content on the left side and have a sidebar on the right side (both positioned side by side), but in firefox the "sidebar" div shifts down and sits diagonally (south-east) to the "article" div. Any ideas how I can fix this?

Last edited by chrishirst; 06-02-2010 at 06:34 PM..
worldy is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 06-02-2010, 06:35 PM Re: Help fixing my CSS
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,376
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
CSS is no use without the HTML it styles!
__________________
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 online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 06-02-2010, 07:58 PM Re: Help fixing my CSS
Super Talker

Posts: 142
Name: William
Trades: 0
I done the exact same thing when I first ventured to css
thanks to chris, I got it fixed by defining my document type

add this to the top of your html page

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
UUilliam is offline
Reply With Quote
View Public Profile
 
Old 06-03-2010, 03:31 PM Re: Help fixing my CSS
Skilled Talker

Posts: 53
Trades: 0
So this is the html I have thus far (its just the template I'm creating) But the problems still persists in Firefox.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<html>
<head>
<link href="css/style.css" rel="stylesheet" type="text/css" media="screen" />
<title>Title</title>
</head>
<body>

<div id="header">
</div>

<div id="content">
<div class="article">
</div>
<div class="sidebar">
</div>
</div>

<div id="footer">
</div>

</body>
</html>
worldy is offline
Reply With Quote
View Public Profile
 
Old 06-03-2010, 04:40 PM Re: Help fixing my CSS
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,376
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
you can't float:right and clear:both on the same element.

if your "sidebar" is going to "float" to the right of "article" it MUST precede it in the document flow.
__________________
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 online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 06-03-2010, 05:47 PM Re: Help fixing my CSS
Skilled Talker

Posts: 53
Trades: 0
Well that worked! Cheers
worldy is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Help fixing my CSS
 

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