Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
Help Formatting clean DIV layout
Old 03-10-2009, 01:37 AM Help Formatting clean DIV layout
tehownererer's Avatar
Novice Talker

Posts: 10
Name: Will
Location: Clinton, Tennessee
Trades: 0
Well i just now finally joined a web design forum after half a semester of taking web design at my high school, and i love it, although I finally set forth to my own projects, and I've stumbled upon some problems. I am trying to redo my schools home page, (which was made with front page and lots of tables ) and I'm using DIVs as the basic layout formatting. The page consists of 3 DIVs (#header, which is the top bar, #leftcol, which is the side bar with the links, and #content, which is the the rest of the page that is in the white background, and is where most of the information is going to go. #maindiv holds it all in, and seemed to be the only solution i could find to keep everything from wrapping!

Everything looks great in Internet Explorer (which i know isn't smiled upon, but hey, compatability makes perfect!)

The problem is, I can't seemed to get it centered in Firefox or Google Chrome.

Another thing is, i used a fixed layout, and after reading other forums, people seemed to have gotten the stink eye for it, but when i tried to use a fluid layout, everything would fall apart and the divs would go on a wrapping spree messing up my whole layout!.

I really appreciate any help / advice / tips, heres my code.

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
<!--
Author: Will Randolph
 -->
<link rel="stylesheet" type="text/css" href="chsstyles.css">
<title>Clinton High School</title>
</head>
<body>
<div id="maindiv">
<div id="header"><span style=
"text-align:center;font-size: 200%;">Clinton High School</span><br>
<i><font face="times" size="5" color="#333333">"Commited to High
Standards"</font></i><br>
<marquee style=
"height:22%;vertical-align: bottom; background-color: black; color: white; font-size: 15px">
Announcements Announcements Announcements
Announcements</marquee></div>
<div id="leftcol"><img class="headlogo" src="headlogo.gif" alt="">
<p><a class="leftlink" href=
"http://www.chs.acs.ac/generalinfo/INFO.htm">General<br>
Information</a></p>
<p><a class="leftlink" href=
"http://www.chs.acs.ac/chshistory/chshistory.htm">CHS
History</a></p>
<p><a class="leftlink" href=
"http://www.acs.ac/Calendar/Approved%20Calendar%202008-09.pdf">Calendar</a></p>
<p><a class="leftlink" href=
"http://www.chs.acs.ac/clinton%20high%20misc/CHS_Tutoring_Opportunities_08-09[1].doc">
Tutoring<br>
Opportunities</a></p>
<p><a class="leftlink" href=
"http://www.chs.acs.ac/library/main.htm">Library</a></p>
<p><a class="leftlink" href=
"http://www.chs.acs.ac/departments/counseling/counselingmain.htm">Counseling</a></p>
<p><a class="leftlink" href=
"http://www.chs.acs.ac/Staff/STAFFCHS.htm">Staff</a></p>
<p><a class="leftlink" href=
"http://www.chs.acs.ac/departments/departments.htm">Departments</a></p>
<p><a class="leftlink" href=
"http://www.chs.acs.ac/activities/CHSactiv.html">Activities</a></p>
<p><a class="leftlink" href=
"http://www.chs.acs.ac/CHSsports/main.htm">Athletics</a></p>
<p><a class="leftlink" href=
"http://www.chs.acs.ac/wall%20of%20fame/Wall%20Of%20Fame%20Nomination%20form.doc">
CHS Wall of<br>
Fame Form</a></p>
</div>
<div id="content">
<p style=
"font-size:100% ;font-family:sans-serif,;font-style: normal; font-weight: lighter; text-align: left;">
Clinton High School, located in Clinton, Tennessee, is  a comprehensive high school serving approximately 1250
students in grades 9-12, is fully accredited by the Southern
Association of Colleges and grading periods. The school operates on
a block schedule which consists of four 90 minute classes.<br>
<br>
The Clinton High School community fosters a commitment to high
standards at all T.I.M.E.S. (Teach, Inspire, Motivate, Empower,
Support)</p>
</div>
</div>
</body>
</html>
Heres the external style sheet.

Code:
body {
  background: black;
  margin: 0 0 0 0;
  overflow:auto;
  text-align: center;

}

#maindiv {
  position: relative;
  height: 514px;
  width:1000px;
  margin: 0 0 0 0;
  text-align: center;
  left: 50%
  margin-left: -500px;
}


img.headlogo {
  border-width: 0;
  clear: left;
}

a.leftlink:hover {color: orange; font-weight: bold}

#header {

  background: orange;
  width:88%;
  height: 16%;
  float: right;

}
#leftcol {
 background: black;
 text-align: left;
 border: none;
 float: left;
 width: 12%;
 height: 100%;


}

a.leftlink {
  text-align: center;
  font-size: 100%;
  color: white;
  font-style: normal;
  text-decoration: none;
  overflow:auto
}


#content {
  height: 99%;
  background: white;
  border: none;
  border-width: 0;
  float: right;
  width: 88%;
  margin: 0 0 0 0;

}
tehownererer is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-10-2009, 03:49 AM Re: Help Formatting clean DIV layout
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,382
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
FireFox and Chrome will have it looking how you have coded it to look, IE will be the one to have it wrong.

http://www.webmaster-talk.com/css-fo...r-website.html

Use a full and valid doctype first then you'll see how IE has it wrong
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 03-10-2009, 07:53 AM Re: Help Formatting clean DIV layout
tehownererer's Avatar
Novice Talker

Posts: 10
Name: Will
Location: Clinton, Tennessee
Trades: 0
Ah i see! Thanks for the references, found out just how to do it.
Sorry about the bad doctype I've been using a WYSIWYG that puts it in for me, and imagine that it would actually make me an invalid one! lazy on my part, so i deserve it i guess lol. Our whole school uses IE so while I'm working on it over there it all looks fine and dandy to me haha. Well time to put google chrome and firefox on my usb flash drive Thanks!
tehownererer is offline
Reply With Quote
View Public Profile
 
Old 03-10-2009, 09:06 AM Re: Help Formatting clean DIV layout
Skilled Talker

Posts: 52
Name: Morten
Trades: 0
Nice answer chrishirst
I thought I should answer this one!
__________________
- Do Nothing!
- Get Nothing!

Please login or register to view this content. Registration is FREE
Rotco88 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Help Formatting clean DIV layout
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.36821 seconds with 12 queries