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 12-17-2008, 10:12 PM CSS stretch
Extreme Talker

Posts: 176
Trades: 0
I can't seem to get css to work at all, it just doesn't do what I want it to.

I need my web site to stretch vertically and horizontally.

Here's the one I'm trying to do right now: http://skeddles.com/v4/css.htm
and the stylesheet: http://skeddles.com/v4/style/layout.css
  • the footer wont stay on it's own line
  • I can't get the two divs in on the sides to stretch vertically
  • if I put an image in the middle, nothing stretches
Here's my first CSS one: http://skeddles.com/v4/index.htm
  • doesn't stretch
Here's the one made with HTML tables: http://skeddles.com/v4/first.html
  • stretches nearly perfectly
I guess I want to know if anyone can help, or give me tips on how to fix my site. And I still don't get why I shouldn't use tables, they seem to be the only thing that works.
Skeddles is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 12-18-2008, 02:03 AM Re: CSS stretch
stevej's Avatar
Professional Multitasker

Posts: 996
Location: Not positive
Trades: 0
I think you would find it a good deal simpler to fix if you tried to condense the layout into as few images as possible.

Quote:
I guess I want to know if anyone can help, or give me tips on how to fix my site. And I still don't get why I shouldn't use tables, they seem to be the only thing that works.
I think that this link explains it pretty well.

Let me know if the problem persists!
- Steve

Last edited by stevej; 12-18-2008 at 02:05 AM.. Reason: found a better link
stevej is offline
Reply With Quote
View Public Profile
 
Old 12-18-2008, 07:00 AM Re: CSS stretch
Andy Pugh's Avatar
Extreme Talker

Posts: 203
Name: Andy
Location: N.Ireland
Trades: 0
Hi there, you really don't want to be using tables, trust me, it really brings down your layout.

I'll give you the basis for a simple header footer / 2 column layout, the header and footer will stretch to the size of your page.

Here is your main page code... you'll need to obviously do your own styling and move your design in to this..
HTML Code:
<!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" dir="ltr" lang="en-US">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

<title>your title</title>

<link rel="stylesheet" href="yourstyle.css" type="text/css" media="screen" />

</head>

<!-- background for expandable header -->
<div id="headerbg">
<h1>your header text</h1>
</div>

<!-- CENTER CONTENT -->
<div id="container">

<div class="left">
    <p>This is the left content</p>
</div>

<div class="right">
    <p>oh, and here is the right</p>
</div>

</div>
    
    <div class="clear"></div>
<div id="footer"><p>put all your footer stuff in here!!</p></div>

And here is your CSS file..

HTML Code:
h1, p, body, html {
    margin:0;
    padding:0;}


body {
    background:#000;
    font:12px verdana, sans-serif;
    color:#000;
    }


#headerbg {
    background:#cccc66;
    text-align:center;
    padding:20px;
    }


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


#footer {
    background:#cccc66;
    padding:10px;
    text-align:center;
    }


.left {
    float:left;
    width:500px;
    background:#ccff66;
    }

.right {
    float:left;
    width:200px;
    clear:right;
    background:#66ff33;
    }

.left p, .right p {
    padding:10px;
    }

.clear {clear:both;}
Hopefully that is what you're looking for, spend a little time getting to know CSS, I assure you it's worth it.

Thanks,
Andy
__________________

Please login or register to view this content. Registration is FREE
Andy Pugh is offline
Reply With Quote
View Public Profile
 
Old 12-18-2008, 11:05 AM Re: CSS stretch
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
#1 rule if you want CSS to work properly - USE A PROPER DOCTYPE - you have NONE on your pages.
#2 rule - if you float an element (except images), you MUST define a WIDTH, something you have not done.

It's not 'working' for you because you haven't mastered it yet.

Best not to put your navigation in divs.. use an unordered list instead, that is, after all, what the nav is - a list.

Your #wrapper is not 'containing' anything because you have not CLEARED your floats. You can add overflow: auto to #wrapper to clear the floats. I would also recommend setting #wrapper to position: relative.

You might also want to read thru this: www.cssslicingguide.com

Your method or creating the boxes with the glow is overly complicated too. Create a vertically narrow repeating background that is the width of your box, including the glow, and then put the rounded top and bottom on as part of the header and footer - much simpler and it WILL stretch vertically.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

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


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


Last edited by LadynRed; 12-18-2008 at 11:06 AM..
LadynRed is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to CSS stretch
 

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