Contact Us Forum Rules Search Archive
WebProWorld Part of WebProNews.com
Page One Link To Us Edit Profile Private Messages Archives FAQ RSS Feeds  
 

Go Back   WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Subscribe to the Newsletter FREE!


Register FAQ Members List Calendar Arcade Chatbox Mark Forums Read

Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-03-2006, 02:04 PM
chrisJumbo's Avatar
WebProWorld Pro
 

Join Date: Oct 2005
Location: California
Posts: 295
chrisJumbo RepRank 1
Default Doc Type problems

I have a page that doesn't display correctly when I include the DocType declaration.

I removed the declaration on this one.
http://www.jumbocdinvestments.com/cdnews.htm

This one has it.
httl://www.jumbocdinvestments.com/test4.htm

Please excuse the loading time also. Two boxes are supposed to be displayed side-by-side at the top of the page. When the DocType is included, the second sits on top of the first, and the first is spread out across the page. The one box loads market data and the second news.

I use CSS to position the boxes. I used two different <span>'s within a <DIV>. The commentary and links at the bottom are two other <span>'s but they seem to be working fine.
__________________
CD Rates | CD Rates Blog | Banking Online
Reply With Quote
  #2 (permalink)  
Old 02-03-2006, 02:17 PM
bodgekaloopie's Avatar
WebProWorld Member
 

Join Date: Aug 2004
Location: Michigan, USA
Posts: 67
bodgekaloopie RepRank 0
Default

Perhaps you are using the wrong DOCTYPE.

http://www.w3schools.com/tags/tag_doctype.asp
http://www.alistapart.com/stories/doctype/
http://www.w3.org/QA/2002/04/valid-dtd-list.html
Reply With Quote
  #3 (permalink)  
Old 02-03-2006, 02:54 PM
dharrison's Avatar
Moderator
WebProWorld Moderator
 

Join Date: May 2005
Location: Essex, UK
Posts: 1,460
dharrison RepRank 3dharrison RepRank 3
Default

As you have 2 stylesheets and a lot of classes referring to those stylesheets, I would've thought you'd be more strict than transitional.

HTH
__________________
Deb Harrison
DVH Design
Essex Web Design | Web Design Blog
Reply With Quote
  #4 (permalink)  
Old 02-03-2006, 06:08 PM
chrisJumbo's Avatar
WebProWorld Pro
 

Join Date: Oct 2005
Location: California
Posts: 295
chrisJumbo RepRank 1
Default RE: DocType problems

I added the strict Doctype to
http://www.jumbocdinvestments.com/test4.htm

and I get the same problem. I've also tested this using FireFox. Having no DocType renders correctly.

I know when you don't specify one it uses "quirks" mode.

Here are my div and span classes. Maybe I've done something that isn't supported anymore.

div.right {position: absolute; top: 2px; left: 145px; width: 80%; height: 400px;
}

div.menu {position: absolute; top: 2px; left: 5px; width: 130px; height: 400px;
}

.stock { /*background-color: #ffff99;*/ position: absolute; top: 75px; left: 0px; width: 205; height: 200px;
}
.news { /*background-color: #ffffff;*/ position: absolute; top: 75px; left: 225px; width: 400; height: 200px;
}
.comm { position: absolute; top: 275px; left: 0px; width: 85%; height: 200px;
}

.link { position: absolute; top: 500px; left: 0px; width: 85%; height: 200px;
__________________
CD Rates | CD Rates Blog | Banking Online
Reply With Quote
  #5 (permalink)  
Old 02-04-2006, 08:30 AM
Faglork's Avatar
WebProWorld Veteran
 

Join Date: Feb 2005
Location: Forchheim, Germany
Posts: 947
Faglork RepRank 0
Default

First: Does your HTML validate?
Second: Does your CSS validate?

Did you check with the Web Developer Extension for FF how your DIVs are actually arranged?

Have you tred to eliminate all other elements, so that only these two boxes are displayed? Are they correct then? If yes, add the other elements until the error occurs. If not, you've got a lot less code to work on.

hth,
faglork
Reply With Quote
  #6 (permalink)  
Old 02-04-2006, 09:34 AM
WebProWorld Member
 

Join Date: Jul 2003
Location: Philadelphia
Posts: 77
dean RepRank 1
Default Re: doctype problems

I noticed that in your classes, .stock and .news , you didn't specify pixels in the width.


.stock { /*background-color: #ffff99;*/ position: absolute; top: 75px; left: 0px; width: 205px; height: 200px;
}
.news { /*background-color: #ffffff;*/ position: absolute; top: 75px; left: 225px; width: 400px; height: 200px;
}
Reply With Quote
  #7 (permalink)  
Old 02-06-2006, 06:52 PM
chrisJumbo's Avatar
WebProWorld Pro
 

Join Date: Oct 2005
Location: California
Posts: 295
chrisJumbo RepRank 1
Default RE: DocType problems

Dean, thank you. That was the problem. My old saying once again proven true. The longer the time it takes to figure out, the dumber the error.

Can you guys point me to a good CSS validation tool? The HTML Editor I use does a good job on the HTML.
__________________
CD Rates | CD Rates Blog | Banking Online
Reply With Quote
  #8 (permalink)  
Old 02-06-2006, 09:21 PM
bodgekaloopie's Avatar
WebProWorld Member
 

Join Date: Aug 2004
Location: Michigan, USA
Posts: 67
bodgekaloopie RepRank 0
Default

If you use Dreamweaver - which I swear by, but a couple of regulars on this forum detest - it has a built in function that will validate your CSS.

You can also use http://validator.w3.org/, and if you use Firefox you can install an extension from https://addons.mozilla.org/ that integrates the w3.org validator right into your browser. IE has a similar developer toolbar add-on that includes a validating function.

Any of these tools makes it very easy to validate your documents, including CSS and HTML.
Reply With Quote
  #9 (permalink)  
Old 03-02-2006, 01:26 PM
iany's Avatar
WebProWorld Pro
 

Join Date: Sep 2003
Location: Stirling, Scotland
Posts: 237
iany RepRank 1
Default

Actually the validator you want for CSS is:
http://jigsaw.w3.org/css-validator/

It's all you need and validates what the server sees.

Ian
__________________
Ian Young
http://www.iyesolutions.co.uk
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Tags: , ,



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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Search Engine Optimization by vBSEO 3.2.0