Help! I can't get my boxes to align!!

This is a discussion on "Help! I can't get my boxes to align!!" within the Starting Out section. This forum, and the thread "Help! I can't get my boxes to align!! are both part of the Design Your Website category.



Go Back   Webforumz.com > Main Forums > Design Your Website > Starting Out

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Jan 29th, 2007, 14:38
Up'n'Coming Member
Join Date: Jan 2007
Location: Canada
Posts: 76
Thanks: 0
Thanked 0 Times in 0 Posts
Exclamation Help! I can't get my boxes to align!!

Hi! I really hope someone can help me... I am trying to get the sidecol to align about 10 or 20 px to the right of the leftcol, and the maincol to align about 20px to the right of the sidecol, all the while not surpassing the 100% width of the Master box. This is a test layout that I would like to use on a site I am about to build. Don't worry about the crappy colors, they are just there to help me see what I am doing... although they don't seem to be helping much lol. Here is the code:

<title>Test layout</title>
<style type="text/css">
<!--
body {
margin: 0px;
padding: 0px;
background-color: #FF0000;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
text-align: center;
}
#master {
position: absolute;
width:100%;
margin-left: 0px;
margin-top: 0px;
border: 0px solid black;
background-color: transparent;
text-align: left;
left: 0px;
height: 900px;
}
#logo {
position: absolute;
width:200px;
height:127px;
top: 0px;
left: 0px;
background-color: #6666FF;
z-index: 3}
#leftcol {
position: absolute;
width:200px;
height:100%;
top: 0px;
left: 0px;
background-color: #6006FF;
z-index: 1;
overflow: auto;
float: left;
margin-top: 0px;
margin-right: 5px;
margin-bottom: 0px;
margin-left: 0px;
}
#navbar {
position: relative;
height:35px;
width: 100%;
top: auto;
text-align: right;
background-color: #010080;
line-height: 35px;
margin: auto;
left: 0px;
overflow: hidden;
}
#picture {
position: relative;
height:92px;
width: 100%;
top: 0px;
right: 0px;
background-color: #010080;
z-index: 1;
left: 0;
background-image: url(Images/testpichead1.jpg);
background-repeat: no-repeat;
}
#bodywrap {
background-color: #999999;
left: 0px;
position: absolute;
padding: 0px;
top: auto;
width: 100%;
margin: 0px;
float: left;
overflow: hidden;
}
#sidecol {
width:200px;
background-color: #00FFFF;
margin-bottom: 20px;
padding: 5px;
margin-left: auto;
position: relative;
float: left;
margin-top: 0px;
margin-right: 0px;
left: auto;
top: 0px;
overflow: hidden;
visibility: visible;
}
#maincol {
width: 400px;
background-color: #99FF66;
margin-bottom: 20px;
padding: 5px;
margin-left: 0px;
top: 0px;
border: 0px solid #000000;
position: relative;
margin-top: 0px;
margin-right: 0px;
float: none;
}
#footer {
width:100%;
height:30px;
clear: both;
padding: 10px 0px;
text-align: center;
color: #000000;
background-color: #FFFF99;
line-height: 25px;
}
-->
</style>
<style type="text/css">
#divFoldCont {position:absolute; left:80px; top:100px; width:170px; visibility:hidden;}
.clFold {position:absolute; width:170px;}
.clFoldSub {position:absolute; left:15px; width:170px; visibility:hidden;}
.clFoldSub2 {position:absolute; left:15px; width:170px; visibility:hidden;}
.clFoldLinks {font-family:Arial, Verdana, Helvetica, Helv; font-size:14px; font-weight:bold; text-decoration:none; color:black;}
.clSubLinks {font-family:Arial, Verdana, Helvetica, Helv; font-size:14px; font-weight:bold; text-decoration:none; color:black;}
.clSubLinks2 {font-family:Arial, Verdana, Helvetica, Helv; font-size:12px; text-decoration:none; color:black;}
.style1 {
font-size: 24px;
font-weight: bold;
}
a {
font-family: Arial, Helvetica, sans-serif;
color: #660066;
font-size: 16px;
font-weight: bold;
}
a:link {
text-decoration: none;
}
a:visited {
text-decoration: none;
color: #660066;
}
a:hover {
text-decoration: underline;
color: #6699FF;
}
a:active {
text-decoration: none;
color: #6699FF;
}
.style2 {color: #FFFFFF}
.style3 {
font-size: 14px;
font-weight: bold;
}
</style>
</head>
<body onload="foldInit()">
<div id="master">
<div id="leftcol">
<p>Left column</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
</div>

<div id="picture">Picture
<div class="style1" id="logo">
<div align="center">
<p>&nbsp;</p>
<p>Logo</p>
</div>
</div>

</div>

<div id="navbar">
<p class="style2">Home | Photo gallery| Contact us </p>
</div>

<div id="bodywrap">

<div id="sidecol" >
<h3>sidebar</h3>
<ul>
<li>List</li>
<li>List</li>
<li>List</li>
</ul>
</div>

<div id="maincol">
<h2>main content</h2>
<p>Blah blah blah blah. </p>
</div>

<div id="footer">
<p class="style3">Footer</p>
</div>

</div>
</div>
</body>
</html>
Reply With Quote

  #2 (permalink)  
Old Jan 29th, 2007, 16:53
moojoo's Avatar
Moderator
Join Date: Aug 2005
Location: Texas
Age: 31
Posts: 1,765
Blog Entries: 1
Thanks: 0
Thanked 18 Times in 18 Posts
Send a message via AIM to moojoo Send a message via MSN to moojoo Send a message via Yahoo to moojoo
Re: Help! I can't get my boxes to align!!

Give us a link pls.
__________________
The internet is just a fad.
http://www.mevans76.com
Last Blog Entry: Apps every Mac based web dev should consider (Jul 10th, 2008)
Reply With Quote
  #3 (permalink)  
Old Jan 29th, 2007, 17:02
Up'n'Coming Member
Join Date: Jan 2007
Location: Canada
Posts: 76
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Help! I can't get my boxes to align!!

Sorry, I'm not sure what you mean... My site (page) isn't online yet, but I could put it on a temporary location if you need it to be online...
Reply With Quote
  #4 (permalink)  
Old Jan 29th, 2007, 17:10
Up'n'Coming Member
Join Date: Jan 2007
Location: Canada
Posts: 76
Thanks: 0
Thanked 0 Times in 0 Posts
Talking Re: Help! I can't get my boxes to align!!

Ok, don't aks me what I did, but it's finally working!!! I have another question though... How do I get my main column to squish like my navbar and footer when I make the window smaller? Thanks again for your help
Reply With Quote
  #5 (permalink)  
Old Jan 29th, 2007, 17:30
Up'n'Coming Member
Join Date: Jan 2007
Location: Canada
Posts: 76
Thanks: 0
Thanked 0 Times in 0 Posts
Oops!

I thought I had fixed it, but it looks horrible at 600X800. I just want 2 seperate boxes (side by side) inside the bodywrap and to the left of the left column, and I'd like it to look good in most browsers from 600X800 and up. Can it be done, or am I a victim of wishful thinking? LOL Here is my new code btw:

<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Test layout</title>
<style type="text/css">
<!--
body {
margin: 0px;
padding: 0px;
background-color: #FF0000;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
text-align: center;
}
#master {
position: absolute;
width:100%;
margin-left: 0px;
margin-top: 0px;
border: 0px solid black;
background-color: transparent;
text-align: left;
left: 0px;
height: 900px;
}
#logo {
position: absolute;
width:200px;
height:127px;
top: 0px;
left: 0px;
background-color: #6666FF;
z-index: 3}
#leftcol {
position: absolute;
width:200px;
height:100%;
top: 0px;
left: 0px;
background-color: #6006FF;
z-index: 1;
float: left;
margin-top: 0px;
margin-right: 5px;
margin-bottom: 0px;
margin-left: 0px;
}
#navbar {
position: relative;
height:35px;
width: 100%;
top: auto;
text-align: right;
background-color: #010080;
line-height: 35px;
margin: auto;
left: 0px;
overflow: hidden;
}
#picture {
position: relative;
height:92px;
width: 100%;
top: 0px;
right: 0px;
background-color: #010080;
z-index: 1;
left: 0;
background-image: url(Images/testpichead1.jpg);
background-repeat: no-repeat;
}
#bodywrap {
background-color: #999999;
left: 0px;
position: absolute;
padding: 0px;
top: auto;
width: 100%;
margin: 0px;
float: left;
overflow: hidden;
}
#sidecol {
width:200px;
background-color: #00FFFF;
margin-bottom: 20px;
padding: 5px;
margin-left: auto;
position: relative;
float: left;
margin-top: 0px;
margin-right: 0px;
left: 20%;
top: 0px;
overflow: hidden;
visibility: visible;
}
#maincol {
width: 550px;
background-color: #99FF66;
margin-bottom: 20px;
padding: 5px;
margin-left: 0px;
top: 0px;
border: 0px solid #000000;
position: relative;
margin-top: 0px;
margin-right: 0px;
float: right;
left: 0%;
}
#footer {
width:100%;
height:30px;
clear: both;
padding: 10px 0px;
text-align: center;
color: #000000;
background-color: #FFFF99;
line-height: 25px;
}
-->
</style>
<style type="text/css">
#divFoldCont {position:absolute; left:80px; top:100px; width:170px; visibility:hidden;}
.clFold {position:absolute; width:170px;}
.clFoldSub {position:absolute; left:15px; width:170px; visibility:hidden;}
.clFoldSub2 {position:absolute; left:15px; width:170px; visibility:hidden;}
.clFoldLinks {font-family:Arial, Verdana, Helvetica, Helv; font-size:14px; font-weight:bold; text-decoration:none; color:black;}
.clSubLinks {font-family:Arial, Verdana, Helvetica, Helv; font-size:14px; font-weight:bold; text-decoration:none; color:black;}
.clSubLinks2 {font-family:Arial, Verdana, Helvetica, Helv; font-size:12px; text-decoration:none; color:black;}
.style1 {
font-size: 24px;
font-weight: bold;
}
a {
font-family: Arial, Helvetica, sans-serif;
color: #660066;
font-size: 16px;
font-weight: bold;
}
a:link {
text-decoration: none;
}
a:visited {
text-decoration: none;
color: #660066;
}
a:hover {
text-decoration: underline;
color: #6699FF;
}
a:active {
text-decoration: none;
color: #6699FF;
}
.style2 {color: #FFFFFF}
.style3 {
font-size: 14px;
font-weight: bold;
}
</style>
</head>
<body onload="foldInit()">
<div id="master">
<div id="leftcol">
<p>Left column</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
</div>

<div id="picture">Picture
<div class="style1" id="logo">
<div align="center">
<p>&nbsp;</p>
<p>Logo</p>
</div>
</div>

</div>

<div id="navbar">
<p class="style2">Home | Photo gallery| Contact us </p>
</div>

<div id="bodywrap">

<div id="sidecol" >
<h3>sidebar</h3>
<ul>
<li>List</li>
<li>List</li>
<li>List</li>
</ul>
</div>

<div id="maincol">
<h2>main content</h2>
<p>Blah blah blah blah. </p>
</div>

<div id="footer">
<p class="style3">Footer</p>
</div>

</div>
</div>
</body>
</html>
Reply With Quote
  #6 (permalink)  
Old Jan 29th, 2007, 19:08
JacobHaug's Avatar
SuperMember

SuperMember
Join Date: Dec 2005
Location: On Internet
Posts: 4,859
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to JacobHaug Send a message via MSN to JacobHaug
Re: Help! I can't get my boxes to align!!

Yes, please put it in a temporary location, it makes it very hard for us to see what is happing without a link. So please upload it somewhere and post a link and we would be glad to help!!
Reply With Quote
  #7 (permalink)  
Old Jan 29th, 2007, 20:02
Up'n'Coming Member
Join Date: Jan 2007
Location: Canada
Posts: 76
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Help! I can't get my boxes to align!!

Ok, here it is:

http://www.personainternet.com/~potier/Tests/Home.html

Thanks again for all your help, it's very appreciated!
Reply With Quote
  #8 (permalink)  
Old Jan 29th, 2007, 20:04
Up'n'Coming Member
Join Date: Jan 2007
Location: Canada
Posts: 76
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Help! I can't get my boxes to align!!

Looking at it again, if the sidebar and maincontent boxes could contract with the window, it may be all that I need for the page to work?
Reply With Quote
  #9 (permalink)  
Old Jan 29th, 2007, 20:18
Up'n'Coming Member
Join Date: Jan 2007
Location: Canada
Posts: 76
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Help! I can't get my boxes to align!!

Also, I would like for them NOT to go under the leftmost column when the window is contracted... Sorry for being such a pest... I've just run out of ideas!
Reply With Quote
  #10 (permalink)  
Old Jan 30th, 2007, 02:34
Reputable Member
Join Date: Jul 2006
Location: Scotland
Age: 22
Posts: 357
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to snow
Re: Help! I can't get my boxes to align!!

Is this something like what you were after? (I haven't fully cleaned up your code there's still a lot of scary, un-needed stuff in there!). I wasn't exactly sure what you wanted...:

CSS

Code: Select all
<!--
body {
    margin: 0px;
    padding: 0px;
    background-color: #FF0000;
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 12px;
    text-align: center;
    text-align: left;
    height: 900px;
}


#logo {

    width:200px;
    height:127px;
    float:left;
    background-color: #6666FF;}

#leftcol {
    width:200px;
    background-color: #6006FF;
    float: left;
}

#navbar {
    height:35px;
    text-align: right;
    background-color: #010080;
    line-height: 35px;
    overflow: hidden;
}

#picture {
    height:92px;
    background:pink url(Images/testpichead1.jpg) no-repeat;
}

#bodywrap {
    background-color: #999999;
    overflow: hidden;
}
#sidecol {
    width:200px;
    background-color: #00FFFF;
    margin-bottom: 20px;
    padding: 5px;
    float: left;
    overflow: hidden;
}
#maincol {
    background-color: #99FF66;
    margin-bottom: 30px;
    padding: 5px 5px 5px 5px;
    border: 0px solid #000000;
}
#footer {
    height:30px;
    padding: 10px 0px;
    text-align: center;
    color: #000000;
    background-color: #FFFF99;
    line-height: 25px;
}
html:

Code: Select all
<body onload="foldInit()">


<div class="style1" id="logo">
<p>Logo</p>
</div>

  <div id="picture">Picture
  </div>

  <div id="navbar">
      <p class="style2">Home | Photo gallery| Contact us  </p>
  </div>

  <div id="leftcol">
    <p>Left column</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
  </div>

  </div>



  <div id="bodywrap">

    <div id="sidecol" >
      <h3>sidebar</h3>
      <ul>
        <li>List</li>
        <li>List</li>
        <li>List</li>
      </ul>
    </div>

    <div id="maincol">
      <h2>main content</h2>
      <p>Blah blah blah blah. </p>
    </div>

    <div id="footer">
      <p class="style3">Footer</p>
    </div>

  </div>
</body>

Hope it's something close!
All the best,
Snow
Reply With Quote
  #11 (permalink)  
Old Jan 30th, 2007, 10:54
Up'n'Coming Member
Join Date: Jan 2007
Location: Canada
Posts: 76
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Help! I can't get my boxes to align!!

Has anyone ever told you Snow that you are a GENIUS!!! The only thing I have to fix is that in ie the reader is a few px too far to the left, but otherwise, it's PERFECT at both resolutions in all 3 browsers I checked it in (ie, ns, ff)(am I missing any major popular browsers that I should add to the mix?). All I have to say is THANK YOU THANK YOU THANK YOU!!! Now I have to go and study your code to see how you did it And see what I can clean up
Lilly
xxx
Reply With Quote
  #12 (permalink)  
Old Jan 30th, 2007, 13:37
Up'n'Coming Member
Join Date: Jan 2007
Location: Canada
Posts: 76
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Help! I can't get my boxes to align!!

Ok, I've played around with it, and I can't seem to get rid of the unwanted space between the logo and the Header+Navbar in IE... I'll show you what I see:



Any help would be greatly appreciated.
Reply With Quote
  #13 (permalink)  
Old Jan 30th, 2007, 13:39
karinne's Avatar
SuperMember

SuperMember
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Help! I can't get my boxes to align!!

you like green much?

What version of IE is that? I don't see that gap in IE6 on Win2000.
Reply With Quote
  #14 (permalink)  
Old Jan 30th, 2007, 13:55
Up'n'Coming Member
Join Date: Jan 2007
Location: Canada
Posts: 76
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Help! I can't get my boxes to align!!

I was in a green mood yesterday, and it goes with my new wallpaper

I am using version 6.0.2800.1106. My resolution is an 1024 X 768, but it does the same thing at 800 X 600.
Reply With Quote
  #15 (permalink)  
Old Jan 30th, 2007, 14:06
karinne's Avatar
SuperMember

SuperMember
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Help! I can't get my boxes to align!!

Here's what I get in FF and IE6

FF.jpg IE.jpg
Reply With Quote
  #16 (permalink)  
Old Jan 30th, 2007, 16:13
Up'n'Coming Member
Join Date: Jan 2007
Location: Canada
Posts: 76
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Help! I can't get my boxes to align!!

Strange... Well, I suppose if the rest of the word can see it properly, that's all that matters Although I'm such a perfectionist, I think I'll still try to play around with it!
Reply With Quote
  #17 (permalink)  
Old Jan 30th, 2007, 16:53
karinne's Avatar
SuperMember

SuperMember
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Help! I can't get my boxes to align!!

Quote:
Originally Posted by Moonlilly View Post
Strange... Well, I suppose if the rest of the word can see it properly, that's all that matters
I hope you were joking with that?
Reply With Quote
  #18 (permalink)  
Old Jan 30th, 2007, 17:12
Up'n'Coming Member
Join Date: Jan 2007
Location: Canada
Posts: 76
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Help! I can't get my boxes to align!!

Yes, don't worry I have been desperately trying to get rid of the annoying space since this morning. No luck yet, but I'm sure it's something really stupid and easy that I'm not thinking about!
Reply With Quote
  #19 (permalink)  
Old Jan 30th, 2007, 17:34
Up'n'Coming Member
Join Date: Jan 2007
Location: Canada
Posts: 76
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Help! I can't get my boxes to align!!

Hi! I just noticed something... If you look at my previous post with the picture of what I see in ie, notice the placement of the sun! That means the whole graphic is being pushed to the right, where as in netscape and firefox, the graphic starts at the very left of the screen like it should. Does this help solve the problem?
Reply With Quote
  #20 (permalink)  
Old Jan 30th, 2007, 17:41
karinne's Avatar
SuperMember

SuperMember
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Help! I can't get my boxes to align!!

So how is this whole thing suppose to look like anyways?
Reply With Quote
Reply

Tags
align, div

Thread Tools

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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sifr Align Right Salbert Flash & Multimedia Forum 8 Apr 2nd, 2008 13:31
How can I align my form boxes? Inkers Web Page Design 22 Jan 25th, 2007 16:43
Align problem Amphersand Web Page Design 3 Oct 11th, 2006 17:11
Stubborn Align virtualwhispers Web Page Design 1 Jun 29th, 2006 16:46
Stubborn Align virtualwhispers Web Page Design 2 Jun 28th, 2006 16:26


All times are GMT. The time now is 05:13.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18