473,435 Members | 1,556 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,435 software developers and data experts.

Need help using <div>s for layout (URL included) ...

I'm trying to set up a page with a header and 2 columns. I would like
to use <div>s rather than tables. The page is here...

http://64.142.13.246/style_testing_s...yle_model2.htm

In both IE 6 and Mozilla 1.3.1 on Windows the two columns overlap a
little with the right column in front. I'd like them to touching but
not overlapping. #leftColumn has a width of 35% and #rightColumn has
left 35% and width 65% so they should just fill the page.

Another thing on that page is that the right column contains a <table>
which is used to lay out some content. I know that's not the
recommended method, but I don't know how you would use CSS to create
that same arrangement and get everything to line up right both
vertically and horizontally.

Thanks for your assistance,

- E

Here are my style definitions (the styles applied to <div>s have id
selectors).

h1, h2, h3 {
color: #004080;
font-weight: 800;
font-family: Verdana, Helvetica, Arial, sans-serif;}

h1 {
font-size: 1.5em;}

h2 {
font-size: 14px;}

h3 {
font-size: 11px;}
a:link {
color: #0080c0;
text-decoration: none;
font-weight: 600;}

a:visited {
color: #0080c0;
text-decoration: none;
font-weight: 600;}

a:hover {
color: #82b9fd;
font-weight: 600;
text-decoration: underline;}

a:active {
color: #ff8000;
font-weight: 600;
text-decoration: underline;}

#topBar1{
margin: 0em;
padding: 0em;
background-color: #8080c0;
height: 15px;}

#topBar2{
margin: 0em;
padding-left: 20px;
padding-right: 0em;
background-color: #c0c0c0;
border-top: 2px #0000a0 solid;
border-left: none;
border-right: none;
border-bottom: 2px #004080 solid;
padding-top: 15px;
padding-bottom: 15px;}

#leftColumn {
position: static;
width: 35%;
border: 1px #ff0000 dashed;
float: left;
padding-top: 20px;
padding-left: 20px;
padding-bottom: 20px;
padding-right: 10px;}

#rightColumn {
background:#FFF;
border: 1px #0000ff dashed;
position: absolute;
left: 35%;
right: 0%;
padding-top: 20px;
padding-left: 10px;
padding-bottom: 20px;
padding-right: 20px;}

p.sitePlanName {
line-height: 16px;
text-decoration: none;
font-size: 12px;
font-weight: 800;
margin: 0em;
padding-left: 0em;
padding-right: 0em;
padding-bottom: 4px;
padding-top: 8px;
border-top: 1px #000080 solid;}

p.sitePlanNotes {
line-height: 16px;
font-size: 11px;
margin: 0em;
padding-left: 0em;
padding-right: 0em;
padding-bottom: 0em;
padding-top: 0em;
color: #8080c0;}

p.sitePlanControls{
line-height: 16px;
font-size: 9px;
margin: 0em;
padding-left: 0em;
padding-right: 0em;
padding-bottom: 8px;
padding-top: 4px;}

p.node {
text-decoration: none;
font-size: 11px;
font-weight: 800;
padding-left: 0em;
padding-right: 0em;
padding-bottom: 0px;
padding-top: 0px;
border-top: 1px #000080 solid;
border: 1px #ff0000 none;
padding: 0em;
margin-left: 4px;
margin-top: 0em;
margin-bottom: 0em;
margin-right: 0em;}

p.nodeNotes {
font-size: 11px;
padding-left: 0em;
padding-right: 0em;
padding-bottom: 0em;
padding-top: 0em;
color: #8080c0;
border: 1px #ff0000 none;
padding: 0em;
margin-left: 4px;
border: 1px #ff0000 none;
margin-top: 0em;
margin-bottom: 0em;
margin-right: 0em;}

p.nodeControls{
font-size: 9px;
border: 1px #ff0000 none;
padding: 0em;
display: block;
white-space: nowrap;
margin: 2px;
border: 1px #ff0000 none;}
Jul 20 '05 #1
2 3544
Ethan wrote:
I'd like them to touching but not overlapping.
Why? I think the overlap looks really good. I'd keep it as-is.

The second part of your post is a little more interesting:
I don't know how you would use CSS to create that same arrangement and
get everything to line up right both vertically and horizontally.


Trees such as that generally work well as an unordered or ordered list
with the list marker hacked off, but the aligned control links are a
little different. What about putting each control in an appropriate
block (DIV, probably, as I can't think of anything better) and then
floating it right within the LI for that part of the tree?

Owen
Jul 20 '05 #2
"Owen Jacobson" <oj**************@mx-deus.net> wrote in message news:<Jk*******************@news20.bellglobal.com> ...
Ethan wrote:
I'd like them to touching but not overlapping.


Why? I think the overlap looks really good. I'd keep it as-is.


OK, I worked with the positioning params of the two columns, and now
it's better, though still not great.

- In Mozilla 1.3 PC and Mac, it's fine.

- In IE 6 PC, the columns no longer overlap unless the browser window
is really narrow. However, there's a gap between them and the width of
the gap changes depending on the width of the window.

- In IE 6 Mac it's totally messed up. The columns completely overlap
and are illegible.

Any way to get this layout to work more or less the same in all of the
above browsers?

Any help would be greatly appreciated.

Thanks,

E

Here is the new stylesheet:

#topBar1{
margin: 0em;
padding: 0em;
background-color: #8080c0;
height: 15px;
z-index: 3;}

#topBar2{
margin: 0em;
padding-left: 20px;
padding-right: 0em;
background-color: #c0c0c0;
border-top: 2px #0000a0 solid;
border-left: none;
border-right: none;
border-bottom: 2px #004080 solid;
padding-top: 20px;
padding-bottom: 20px;
z-index: 4;}

h2.appTitle {
margin: 0em;
padding: 0em;
line-height: 15px;
vertical-align: middle;}

p.blank {
margin: 0em;
padding: 0em;
line-height: 1px;}

#leftColumn {
position: absolute;
border: 1px #ff0000 none;
padding-top: 20px;
padding-left: 20px;
padding-bottom: 20px;
padding-right: 10px;
margin: 0em;
left: 0%;
top: 75px;
z-index: 2;
right: 65%;}

#rightColumn {
background:#FFF;
border: 1px #0000ff none;
position: absolute;
right: 0%;
padding-top: 20px;
padding-left: 10px;
padding-bottom: 20px;
padding-right: 20px;
top: 75px;
margin: 0em;
z-index: 1;
left: 35%;}

p.sitePlanName {
line-height: 16px;
text-decoration: none;
font-size: 12px;
font-weight: 800;
margin: 0em;
padding-left: 0em;
padding-right: 0em;
padding-bottom: 4px;
padding-top: 8px;
border-top: 1px #000080 solid;}

p.sitePlanNotes {
line-height: 16px;
font-size: 11px;
margin: 0em;
padding-left: 0em;
padding-right: 0em;
padding-bottom: 0em;
padding-top: 0em;
color: #8080c0;}

p.sitePlanControls{
line-height: 16px;
font-size: 9px;
margin: 0em;
padding-left: 0em;
padding-right: 0em;
padding-bottom: 8px;
padding-top: 4px;}

p.node {
text-decoration: none;
font-size: 11px;
font-weight: 800;
padding-left: 0em;
padding-right: 0em;
padding-bottom: 0px;
padding-top: 0px;
border-top: 1px #000080 solid;
border: 1px #ff0000 none;
padding: 0em;
margin-left: 4px;
margin-top: 0em;
margin-bottom: 0em;
margin-right: 0em;}

p.nodeNotes {
font-size: 11px;
padding-left: 0em;
padding-right: 0em;
padding-bottom: 0em;
padding-top: 0em;
color: #8080c0;
border: 1px #ff0000 none;
padding: 0em;
margin-left: 4px;
border: 1px #ff0000 none;
margin-top: 0em;
margin-bottom: 0em;
margin-right: 0em;}

p.nodeControls{
font-size: 9px;
border: 1px #ff0000 none;
padding: 0em;
display: block;
white-space: nowrap;
margin: 2px;
border: 1px #ff0000 none;}
Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

61
by: Toby Austin | last post by:
I'm trying to replace <table>s with <div>s as much as possible. However, I can't figure out how to do the following… <table> <tr> <td valign="top" width="100%">some data that will...
4
by: nick | last post by:
The structure is very simple: <div style="WIDTH: 500px; HEIGHT: 50px; BACKGROUND-COLOR: aqua"> <div id="nav"> <a href="#">menu1</a> </div> </div> I want to let the "nav" div sink at the...
18
by: Timothy Casey | last post by:
Thanks in advance... =~= Timothy Casey South Australia worloq@iprimus.com.au Formerly: casey@smart.net.au
1
by: Mel | last post by:
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA A, B, C, D, E are all <iframes> A's are : width:100% height:60px B's : width:80px height:100% (or adjustable) C's : width:100% height:100% (or...
2
by: listaction | last post by:
Hi Folks, can you help me by explaining how the code below can be translated using <div> and achieve the same effect? Thanks, LA <html> <body> <table bgcolor="#000000" width="100%"...
2
by: ad | last post by:
When we create a new aspx in VS.Net, it will insert <div> tag inside <form> tag, like below. What is the function of <div> do?...
28
by: Kent Feiler | last post by:
1. Here's some html from a W3C recommendations page. <P>aaaaaaaaa<DIV>bbbbbbbbb</DIV><DIV>cccccccc<P>dddddddd</DIV> 2.Although I didn't think it would make any difference, I tried it with the...
1
by: menmysql | last post by:
hi to all i want to place a division(using <div> tag) at a perticular location(x,y). is it possible. if possible please tell me how to do it. regards
6
goatboy
by: goatboy | last post by:
So I am hosting a site from my home server, and I would like the main page to be an area for updates about the site. I am providing these updates in a blog-style format, using this code: ...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.