Help - Search - Members - Calendar
Full Version: side bar not staying with-in set size
HTMLHelp Forums > Web Authoring > Markup (HTML, XHTML, XML)
FabianN
So heres the issue.
I have a navigation bar on the left that should be no wider than needed. Just enough for it's contents, and no more.
To the right of that should be the content box which should stretch to fill the browser window.
This works as it should on most of the pages, but this is due to the content pushing the break between the navigation to the left.

But there are two pages that are just simple lists and are not that wide of content, and on these pages the space that the navigation box takes up is wider than it should be, which then off-sets all of the alignment in the content box.

One of the pages that shows this is
http://www.daisyducks.org/index.php?pg=members

That list of positions and names is aligned to the left. I would like them to be right up next to the navigation bar like the rest of the site, but they are unable to because the navigation cell is stretching more than it should.
I'm using simple php to separate the site into blocks (header, navigation, content, footer)

Here is the html of the navbar block, CSS for that block included
CODE

<style type="text/css">
<!--

#navspace{
        vertical-align:top;
        padding-top: 15px;
        padding-left: 10px;
        padding-right: 5px;
        width: 159px;
}
#navbarmain{
        width:144 px;
        border: 0 px;
}
#navbarlinks{
}
a.nav{
    color:#000;
    font-weight:bold;
    /*text-decoration:none;*/
    border-left: 3px solid yellow;
    /*background-color:#093;*/
    padding: 1px;
    font-family:Arial, Helvetica, sans-serif;
    font-size:13px;
}
a:link.nav{
}
a:visited.nav{
}
a:hover.nav{
    color:#FF3;
    border-left: 3px solid green;
}
a:active.nav{
    color:#FF3;
    border-left: 3px solid #6F3;
}
ul.nav{
        list-style-type:none;
        margin: 0;
        padding:0;
        padding-left:4px;
}
li.nav{
    margin-bottom:2px;
}


-->
</style>

<td width="159" id="navspace">
<table width="144" cellpadding="0" cellspacing="0" id="navbarmain"><tr><td background="interface/img/navbar_mid.png"><img src="interface/img/navbar_top.png" /></td></tr><tr><td id="navbarlinks" background="interface/img/navbar_mid.png">

            
            <ul class="nav">
            <li class="nav"><a class="nav" href="index.php">Home</a></li>
            <li class="nav"><a class="nav" href="index.php?pg=greet">President's Message</a></li>
            <li class="nav"><a class="nav" href="index.php?pg=members">Board Members</a></li>
            <li class="nav"><a class="nav" href="index.php?pg=inmemoriam">In Memoriam</a></li>
            <li class="nav"><a class="nav" href="index.php?pg=membership">Membership Info</a></li>
            <li class="nav"><a class="nav" href="index.php?pg=committees">Sports Committees</a></li>
            <li class="nav"><a class="nav" href="index.php?pg=projects">Daisy Projects</a></li>
            <li class="nav"><a class="nav" href="index.php?pg=events">Events Calendar</a></li>
            <li class="nav"><a class="nav" href="index.php?pg=othercommittees">Other Committees</a></li>
            <li class="nav"><a class="nav" href="index.php?pg=meetus">An Evening w/ Daisies</a></li>
            <li class="nav"><a class="nav" href="index.php?pg=quackchat">Quack Chat</a></li>
            <li class="nav"><a class="nav" href="index.php?pg=photos">Photo Album</a></li>




           </ul>
            
</td></tr><tr><td><img src="interface/img/navbar_bot.png" width="144" height="29" /></td></tr>
</table><br />
<span style="font-size:14px; font-weight:normal;">
<a href="http://www.goducks.com/">GoDucks.com</a><br>
<a href="http://uoalumni.com/">UO Alumni Assoc</a><br>
<a href="http://coachbellotti.com/">Coach Bellotti</a><br>
<a href="http://ducknews.com/quick_quacks">DuckNews.com</a><br>
<a href="http://oregonlive.com/weblogs/ducksblog/">Ducksblog</a><br>
<a href="http://oregontrackclub.org/">Oregon Track Club</a><br>
<a href="http://mail.daisyducks.org">Login to Daisy Email</a>
</span>
</td>


Here is the code of the over-all page minus the PHP.
There are HTML comments where the nav bar, contents, etc go.


CODE

<!-- Site Designed and coded by Fabian Norman, FabianN AT gmail DOT com -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Oregon Daisy Ducks</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link href="css/index.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table cellpadding="0" cellspacing="0" width="100%">
<!--LOGO-->
<tr>
<!--Navigation Bar-->
    <td class="body">
<!--Body contents-->
        
    </td>
</tr>
<!--Footer-->
</table>
</body>
</html>


I have have just plain text in the content box, but as long as it doesn't completely span the content box and forces it to stretch, the navigation bar will have that bit of over-flow.

Another good example is the error page, though it's not noticeable unless you have a tool that will highlight the various blocks of a page
http://www.daisyducks.org/index.php?pg=pfsdfs

I've put width settings on every part of this that I can think would apply to this, and no matter what it doesn't size down.

Anyone got help?
pandy
Remove the width="100%" you have in the first TD.

You need to clean this up.
http://www.htmlhelp.com/cgi-bin/validate.c...s&input=yes

You shouldn't use an XHTML 1.1 doctype. You don't write anything close to XHTML, especially not 1.1. If you must, use XHTML 1.0 and make your documents conform to it.

You may also want to use a background color. Those white corner pictures doesn't look good against a browser background that isn't white.
FabianN
QUOTE(pandy @ Nov 17 2009, 08:39 PM) *

Remove the width="100%" you have in the first TD.

You need to clean this up.
http://www.htmlhelp.com/cgi-bin/validate.c...s&input=yes

You shouldn't use an XHTML 1.1 doctype. You don't write anything close to XHTML, especially not 1.1. If you must, use XHTML 1.0 and make your documents conform to it.

You may also want to use a background color. Those white corner pictures doesn't look good against a browser background that isn't white.

Yea, I know I need to refresh. It's been years since I last looked at web design and this was a project that a bunch of old ladies asked dearly of me to do for them, which I did. Sloppy, but it works.
(it's hard to argue with grandma baking laugh.gif )

But that fix causes another issue. Then the entire block of the site gets cut down in size.
Got a screen shot to show
http://img.photobucket.com/albums/v68/FabianN/page.jpg

Is this just out of my use of a mix of old and new code and not having refreshed myself in years?
pandy
Remove width="100%" from the first TD, not from TABLE.

Those old ladies specifically asked for XHTML 1.1, did they? wink.gif
FabianN
QUOTE(pandy @ Nov 17 2009, 09:32 PM) *

Remove width="100%" from the first TD, not from TABLE.

Those old ladies specifically asked for XHTML 1.1, did they? wink.gif

ah, I wasn't thinking of the logo/header. blush.gif
Thanks.
And no, they didn't ask specifically. I mean they asked me to use my amateur web coding skills that I put together many years ago and haven't used in a very long time to quickly throw a site together.
And actually I'm thinking the doc type comes out of that they wanted it set-up so they could use dreamweaver to easy add more content pages (or change content), so I used that as the coding application (so I can have the same POV for them), and that's what it sets the doc type on a new file.

Anyway, thanks a bunch for the help. It's much appreciated.
They will be wanting more work done, so I'll take your advice and tweak it more and fix it up over time.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.