Current location: Hot Scripts Forums » General Web Coding » CSS » xhtml + css


xhtml + css

Reply
  #1 (permalink)  
Old 06-11-03, 12:15 PM
rockerBOO rockerBOO is offline
AVALANCHE MUSIC
 
Join Date: Jun 2003
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
xhtml + css

I want to make a page fully xhtml strict compliant, but i am having some css problems.

So what i want to do is have the page formated like this.

| HEADER +++++++++++++ |
| MENU | MAINCONTENT +++|
| ++++ | ++++++++++++++|
| FOOTER +++++++++++++|

+ = spacing.

but when i do that, the main content either goes below the menu or goes behind the menu, depending on the browser. If anyone could help out i would appeciate it very much. Thanks.

rockerBOO
Reply With Quote
  #2 (permalink)  
Old 06-11-03, 12:34 PM
daynah's Avatar
daynah daynah is offline
Newbie Coder
 
Join Date: Jun 2003
Location: CA, USA
Posts: 69
Thanks: 0
Thanked 0 Times in 0 Posts
Hi rockerBOO,

I would just use absolute (or relative) CSS positioning for this layout. Just be sure to separate your data from your style. And validate your page at http://validator.w3.org


Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml/DTD/xhtml-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <style>
  .headerDiv
  {
      position: absolute;
      top: 0px;
      left: 0px;
  }
  .menuDiv
  {
      position: absolute;
      top: 80px;
      left: 10px;
      height: 300px;
      width: 180px;
  }
  .footerDiv
  {
      position: absolute;
      bottom: 0px;
      left: 0px;
  }
  .maincontentDiv
  {
      position: absolute;
      top: 310px;
      left: 190px;
      width: 400px;
  }
  <style>
</head>

<body>

<div class="headerDiv"><img src="header.jpg"></div>
<div class="menuDiv">
- menu1<br />
- menu1<br />
- menu1<br />
- menu1<br />
- menu1<br />
</div>
<div class="maincontentDiv">
The content goes here. The content
 goes here. The content goes here. 
The content goes here. The content 
goes here. The content goes here. 
The content goes here. The content 
goes here. The content goes here. 
The content goes here. The content
 goes here. The content goes here. 
The content goes here. The content
 goes here. The content goes here. 

</div>
<div class="footerDiv"><img src="footer.jpg"></div>

</body>
</html>
__________________
PHP Princess.net | Daynah.net

Last edited by daynah; 06-11-03 at 12:36 PM.
Reply With Quote
  #3 (permalink)  
Old 06-11-03, 12:37 PM
rockerBOO rockerBOO is offline
AVALANCHE MUSIC
 
Join Date: Jun 2003
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
that will work with everything but the footer, because that will stick to the bottom of the browser window and mess up what i am viewing. I was hoping to go into the relative area of this, but who knows if that will work. Thanks though. I will use that if all goes bad.
__________________
http://avalanche-music.com/images/ad/sign.png
AVALANCHE-MUSIC - talk. react. music.
BBMods : Modify Your BBS! - rboo tutorials : tutorials for the web designer in mind
LEARN:SOMETHING
Reply With Quote
  #4 (permalink)  
Old 06-11-03, 12:39 PM
daynah's Avatar
daynah daynah is offline
Newbie Coder
 
Join Date: Jun 2003
Location: CA, USA
Posts: 69
Thanks: 0
Thanked 0 Times in 0 Posts
You can use the tables way as well.
__________________
PHP Princess.net | Daynah.net
Reply With Quote
  #5 (permalink)  
Old 06-11-03, 12:39 PM
rockerBOO rockerBOO is offline
AVALANCHE MUSIC
 
Join Date: Jun 2003
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
but i want it to be xhtml strict so no table there...
__________________
http://avalanche-music.com/images/ad/sign.png
AVALANCHE-MUSIC - talk. react. music.
BBMods : Modify Your BBS! - rboo tutorials : tutorials for the web designer in mind
LEARN:SOMETHING
Reply With Quote
  #6 (permalink)  
Old 06-20-03, 10:54 AM
grimlock grimlock is offline
New Member
 
Join Date: Jun 2003
Location: Vancouver
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Cool CSS problem

Hi there,

I guess it is hard to get the footer to cross the whole page again without breaking up the whole design. Try to integrate the Menu as a nested float in the central box.
eg: http://glish.com/css/1.asp

That way you have three boxes on the page. header main and footer, with a floating menu in the main box.

Hope it helps

Ciao
Grimlock
Reply With Quote
  #7 (permalink)  
Old 06-20-03, 02:47 PM
rockerBOO rockerBOO is offline
AVALANCHE MUSIC
 
Join Date: Jun 2003
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
I have worked on it, and i think i finally got it working, learn a lot trying to do this though. I will try to keep you all updated.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
dynamic url's in xhtml pages? tom HTML/XHTML/XML 4 09-26-03 05:11 PM
Why Doesn't Anyone Learn XML? Isaac HTML/XHTML/XML 23 08-21-03 09:38 AM
XHTML data as ouput using C inag123 HTML/XHTML/XML 1 07-20-03 09:53 AM


All times are GMT -5. The time now is 01:45 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.