jyoseph
10-10-2005, 07:20 PM
Hello,
I'm running into a few snags in building my first 'tableless' all CSS layout. (Not in the code, I can code everything out nicely. This is more of a "I need advice" post not a "How do I align this or make this red" post)
I am having a hard time deciding how to build the site in a way that won't be confusing when I want to add pages page with different structure, widths, etc.
For instance, the front page has 3 columns but I want an about page to have two colums with completely different widths.
Would you suggest something like this: (For this example I'm more interested in the naming scheme than I am in how tidy the code is)
#Frame{
position: relative;
width:800px;
left:0px;
top:0px;
margin:0px 0px 0px 0px;
}
#MainPage_ColumnOne{
position:absolute;
width:395px;
top:0px;
left:0px;
margin:0px 0px 0px 0px;
}
#MainPage_ColumnTwo{
position:relative;
width:195px;
top:0px;
left:405px;
margin:0px;
}
#AboutPage_ColumnOne{
position:absolute;
width:695px;
top:0px;
left:0px;
margin:0px 0px 0px 0px;
}
#AboutPage_ColumnTwo{
position:relative;
width:105px;
top:0px;
left:695px;
margin:0px;
}
and then the HTML for the main page like so:
<div id="Frame">
<div id="MainPage_ColumnOne">Stuff</div>
<div id="MainPage_ColumnTwo">Stuff</div>
</div>
and then the HTML for the About Page like so:
<div id="Frame">
<div id="AboutPage_ColumnOne">Stuff</div>
<div id="AboutPage_ColumnTwo">Stuff</div>
</div>
Today I thought about possibly assigning an ID to the <body> tag and naming it after whatever page you were on. Is that a bad idea? Like so:
<body id="MainPage">
and then use CSS like:
#MainPage .ColumnOne{
position:absolute;
width:395px;
top:0px;
left:0px;
margin:0px 0px 0px 0px;
}
#AboutPage .ColumnOne{
position:absolute;
width:395px;
top:0px;
left:0px;
margin:0px 0px 0px 0px;
}
#ContactPage .ColumnOne{
position:absolute;
width:395px;
top:0px;
left:0px;
margin:0px 0px 0px 0px;
}
Is this overkill or does it even make sense. I'm just looking for a way to manage multiple pages in a way that will be easy. I think it just comes down to a naming scheme that I would be able to follow.
Any help on what has worked for you would be really nice. I'm really new to CSS and want everything structured in a way that will be easy when it comes to adding pages.
Thanks in advance!
-Jyoseph
www.jyoseph.com
I'm running into a few snags in building my first 'tableless' all CSS layout. (Not in the code, I can code everything out nicely. This is more of a "I need advice" post not a "How do I align this or make this red" post)
I am having a hard time deciding how to build the site in a way that won't be confusing when I want to add pages page with different structure, widths, etc.
For instance, the front page has 3 columns but I want an about page to have two colums with completely different widths.
Would you suggest something like this: (For this example I'm more interested in the naming scheme than I am in how tidy the code is)
#Frame{
position: relative;
width:800px;
left:0px;
top:0px;
margin:0px 0px 0px 0px;
}
#MainPage_ColumnOne{
position:absolute;
width:395px;
top:0px;
left:0px;
margin:0px 0px 0px 0px;
}
#MainPage_ColumnTwo{
position:relative;
width:195px;
top:0px;
left:405px;
margin:0px;
}
#AboutPage_ColumnOne{
position:absolute;
width:695px;
top:0px;
left:0px;
margin:0px 0px 0px 0px;
}
#AboutPage_ColumnTwo{
position:relative;
width:105px;
top:0px;
left:695px;
margin:0px;
}
and then the HTML for the main page like so:
<div id="Frame">
<div id="MainPage_ColumnOne">Stuff</div>
<div id="MainPage_ColumnTwo">Stuff</div>
</div>
and then the HTML for the About Page like so:
<div id="Frame">
<div id="AboutPage_ColumnOne">Stuff</div>
<div id="AboutPage_ColumnTwo">Stuff</div>
</div>
Today I thought about possibly assigning an ID to the <body> tag and naming it after whatever page you were on. Is that a bad idea? Like so:
<body id="MainPage">
and then use CSS like:
#MainPage .ColumnOne{
position:absolute;
width:395px;
top:0px;
left:0px;
margin:0px 0px 0px 0px;
}
#AboutPage .ColumnOne{
position:absolute;
width:395px;
top:0px;
left:0px;
margin:0px 0px 0px 0px;
}
#ContactPage .ColumnOne{
position:absolute;
width:395px;
top:0px;
left:0px;
margin:0px 0px 0px 0px;
}
Is this overkill or does it even make sense. I'm just looking for a way to manage multiple pages in a way that will be easy. I think it just comes down to a naming scheme that I would be able to follow.
Any help on what has worked for you would be really nice. I'm really new to CSS and want everything structured in a way that will be easy when it comes to adding pages.
Thanks in advance!
-Jyoseph
www.jyoseph.com