Click to See Complete Forum and Search --> : CSS Anomaly!


JadieGlitch
09-19-2008, 05:30 PM
I am trying to get the left hand side of my page to be 'position:fixed;'

When I have a comment in the very top of the page it doesn't work, but the rest of the page displays correctly.

When I remove the comment, the 'position:fixed;' activates, but the rest of the page formatting is wrong.

How can a simple comment do this?? I've even had people at the software company that I work say "Whoa... I have never seen that before.. and I don't know how to fix it... good luck with that...".

Here is my page (HomePage.jsp)




<!-- Jadie's Colubrids
Author: Jeannie M. Davis
Page: HomePage.jsp
Inception: 08.11.2008
ŠJadies's Colubrids All Rights Reserved.

Purpose: This module is designed for HTML
and CSS training purposes.
-->


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >


<head>

<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />

<title>Jadie's Colubrids</title>

<script type="text/javascript"></script>

<link href="D:\Play\PersonalWebsite\WebContent\CSS\Style.css" type="text/css"
rel="stylesheet" media = "all"/>

</head>


<body>
<!-- This chunk of code handles the fixed bar of information on the left-hand side of the page -->
<div id="containerJadiesColubrids">
<div id="introJadie">
<div id="pageJadie"></div>
</div>

<div id="introColubrid">
<div id="pageColubrids"></div>
</div>

<div id="quickSummary">
<p class="p1"><span></span></p>
<p class="p2"><span><a href="" title="">e-mail</a></span></p>
<p class="p3"><span><a href="Available.jsp" title="">Available Snakes</a></span></p>
<p class="p4"><span><a href="PhotoGallery.jsp" title="">Photo Gallery</a></span></p>
<p class="p5"><span><a href="BreedingStock.jsp" title="">Breeding Stock</a></span></p>
<p class="p6"><span><a href="MorphGuide.jsp" title="">Morph Guide</a></span></p>
<p class="p7"><span><a href="Shipping.jsp" title="">Shipping Info</a></span></p>
<p class="p8"><span><a href="Store.jsp" title="">Store</a></span></p>
<p class="p9"><span><a href="Sold.jsp" title="">Sold</a></span></p>
</div>

<!-- This chunk handles the right hand side of the page with the text in it.
It is included within the 'containerJadiesColubrids'-->
<div id="News">
<h3><span>News</span></h3>
<p class="p1"><span>Welcome to the Launch of Jadie's Colubrids!</span></p>
<p class="p2"><span>I will try to update as much as possible and I hope you check back often for new and interesting things.</span></p>
<p class="p3"><span>Filler for p3</span></p>
</div>

<div id="supportingText">
<div id="explanation">
<h3><span>What is a Colubrid?</span></h3>
<p class="p1"><span>A colubrid (from Latin coluber, snake) is a snake that is a member of the Colubridae family. It is a broad classification of snakes that includes well over half of all snake species on earth. A colubrid's body is almost completely covered in scales. While most colubrids are non-venomous (or have venom that isn't known to be harmful to humans) and are normally harmless, a few groups, such as genus Boiga, can produce medically significant bites. In addition, the Boomslang and African Twig Snake have both caused human fatalities.The venom-injecting fangs associated with venomous colubrids are almost always in the back of the mouth, compared to vipers and elapids. The Colubrids are certainly not a natural group, as many are more closely related to other groups, such as elapids, than to each other. This family has classically been a dumping ground for snakes that don't fit anywhere else. There is on-going mitochondrial DNA research which will sort out the familiar relations within this group.A colubrid (from Latin coluber, snake) is a snake that is a member of the Colubridae family. It is a broad classification of snakes that includes well over half of all snake species on earth. A colubrid's body is almost completely covered in scales. While most colubrids are non-venomous (or have venom that isn't known to be harmful to humans) and are normally harmless, a few groups, such as genus Boiga, can produce medically significant bites. In addition, the Boomslang and African Twig Snake have both caused human fatalities.The venom-injecting fangs associated with venomous colubrids are almost always in the back of the mouth, compared to vipers and elapids. The Colubrids are certainly not a natural group, as many are more closely related to other groups, such as elapids, than to each other. This family has classically been a dumping ground for snakes that don't fit anywhere else. There is on-going mitochondrial DNA research which will sort out the familiar relations within this group.</span></p>
<p class="p2"><span>Link to the <a href = "http://en.wikipedia.org/wiki/Colubridae">original article</a></span></p>
</div>

<div id="footer">
<a href="">Home</a> &nbsp;
<a href="">Contact Us</a> &nbsp;
<a href="">FAQs</a> &nbsp;
<a href="http://www.cornsnakes.com">The Cornsnake Info Forums</a> &nbsp;
<a href="">Tribute</a>
</div>

</div>

<!-- This is the image rotation for the PhotoGallery feature -->
<div id="linkList">
<div id="lselect">
<h3 class="select"><span>Photos:</span></h3>
<ul>
<li>
<!-- Images rotate here. -->
<a href="WebContent/PictureArchive/Archive.jsp" >
<script language="javascript" type="text/javascript">

var slideShowSpeed = 1900; // Set slideShowSpeed (milliseconds)
var crossFadeDuration = 3; // Duration of crossfade (seconds).
var arrBanner = new Array();

arrBanner[0] = 'IMAGES/Isis.gif'
arrBanner[1] = 'IMAGES/Calcifer.gif'
arrBanner[2] = 'IMAGES/RahBehKaa.gif'
arrBanner[3] = 'IMAGES/Delilah.gif'
arrBanner[4] = 'IMAGES/Isis2.gif'

function initSlideShow() {
var preLoad = new Array();
for (var i = 0; i < arrBanner.length; i++) {
preLoad[i] = new Image();
preLoad[i].src = arrBanner[i];
}
var rndId = Math.floor(Math.random()*arrBanner.length);
document.write('<img src="'+arrBanner[rndId]+'" name="SlideShow" id="SlideShow" width="200" height="150" />');
window.setInterval('runSlideShow()', slideShowSpeed);
} // initSlideShow.

function runSlideShow(){
rndId = Math.floor(Math.random()*arrBanner.length);
if (document.all){
document.images.SlideShow.style.filter = "blendTrans(duration=2)";
document.images.SlideShow.style.filter = "blendTrans(duration=crossFadeDuration)";
document.images.SlideShow.filters.blendTrans.Apply() ;
}
document.images.SlideShow.src = arrBanner[rndId];
if (document.all){
document.images.SlideShow.filters.blendTrans.Play();
}
} // runSlideShow.

initSlideShow();

</script>

</a>submitted by Jadie&nbsp;
</li>
</ul>
</div>

<!-- This is where the the image rotation for the StoreGallery feature will go -->
<div id="lStore">
<h3 class="Store"><span>Store:</span></h3>
<ul>
<li>
<a href="WebContent/IMAGES/ReptiBark.gif">
<img id="rotate_img" src="IMAGES/ReptiBark.gif" width = "150" height = "200" alt="Isis" />
</a> 8lbs for $19.99
</li>
</ul>
</div>

<!-- This is in the middle white space below the Image Rotators -->
<div id="lresources">
<h3 class="resources"><span>Resources:</span></h3>
<ul>
<li><a href="http://www.beanfarm.com/store/agora.cgi?cart_id=2050976.5791&p_id=12093&xm=on"><span>Cornsnakes by Kathy Love</span></a></li>
<li><a href="http://www.beanfarm.com/store/agora.cgi?cart_id=2050976.5791&p_id=12092&xm=on"><span>Cornsnakes in Captivity by Dan Soderberg</span></a></li>
<li><a href="http://www.beanfarm.com/store/agora.cgi?cart_id=2050976.5791&p_id=12094&xm=on"><span>Cornsnake Morph Guide</span></a></li>
<li><a href="http://www.cornsnakes.com"><span>Cornsnakes.com</span></a></li>
<li><a href="http://www.cornutopia.com"><span>Cornutopia</span></a></li>
</ul>
</div>
</div>
</div>


<div id="extraDiv1"><span></span></div><div id="extraDiv2"><span></span></div><div id="extraDiv3"><span></span></div>
<div id="extraDiv4"><span></span></div><div id="extraDiv5"><span></span></div><div id="extraDiv6"><span></span></div>

</body>
</html>

JadieGlitch
09-19-2008, 05:31 PM
And here is my CSS (Style.css):





body {
background: url(D:\Play\PersonalWebsite\WebContent\IMAGES\bg.gif) left top repeat-y #663;
background-attachment: fixed;
margin: 0;
padding: 0;
font-family: "Trebuchet MS", Tahoma, Lucida Sans, Arial, Verdana, Helvetica, sans-serif;
}

a img {
border:none;
}

abbr, acronym {
border-bottom: 1px dotted #630;
}

div#pageJadie h1, div#pageJadie h2, div#linkList h3 {
display: none;
}

div#containerJadiesColubrids {
display: block;
}

div#introIntro {
display: block;
}

@media screen {
div#pageJadie, div#quickSummary, div#pageColubrids {
position: fixed;
}

* html div#pageJadie, * html div#quickSummary, * html div#pageColubrids {
position: absolute;

}
}

div#pageJadie {
left: 10;
top: 0;
width: 177px;
height: 85px;
background: url(D:\Play\PersonalWebsite\WebContent\IMAGES\Jadie.gif) left top no-repeat;
}

div#pageColubrids h1, div#pageColubrids h2, div#linkList h3 {
display: none;
}

div#introColubrid {
display: block;
}

div#pageColubrids {
left: 20;
top: 75;
width: 177px;
height: 85px;
background: url(D:\Play\PersonalWebsite\WebContent\IMAGES\Colubrids.gif) left top no-repeat;
}

div#quickSummary {
left: 0;
top: 250px;
width: 185px;
color: #3F0;
font-size: 12px;
padding: 5px;
padding-right: 10px;
}

div#quickSummary a {
font-weight: bold;
color: #FFF;
}

div#quickSummary a:hover {
color: #000;
}

div#News, div#supportingText {
margin-left: 463px;
padding: 10px;
padding-left: 20px;
padding-bottom: 0;
}

div#News h3, div#supportingText h3 {
display: block;
background: url(D:\Play\PersonalWebsite\WebContent\IMAGES\hatching.gif) left top repeat #000;
margin: 0;
padding: 0;
padding-left: 20px;
color: #FFF;
font-size: 24px;
line-height: 50px;
text-transform: lowercase;
}

div#News p, div#supportingText p {
font-size: 14px;
color: #000;
line-height: 1.5em;
}

div#News a, div#supportingText a {
color: #000;
}

div#News a:hover, div#supportingText a:hover {
color: #FFF;
}

div#News abbr, div#News acronym, div#supportingText abbr, div#supportingText acronym {
border-bottom: 1px dotted #000;
}

div#footer {
display: block;
height: 20px;
background: url(D:\Play\PersonalWebsite\WebContent\IMAGES\hatching.gif) left top repeat #000;
padding: 3px;
font-size: 12px;
line-height: 20px;
text-align: center;
margin-bottom: 10px;
}

div#footer a {
color: #FFF;
font-weight: bold;
}

div#footer a:hover {
color: #000;
}

div#linkList {
position: absolute;
left: 200px;
top: 0px;
width: 263px;
font-family: Baskerville, Georgia, Garamond, Times New Roman, serif;
}

div#linkList ul {
list-style: none;
padding: 0;
margin: 0;
}

div#linkList ul {
list-style: none;
}

div#linkList ul li {
border-bottom: 1px solid #630;
}

div#linkList ul li a {
display: block;
padding: 5px;
padding-left: 20px;
padding-right: 20px;
font-weight: bold;
font-size: 12px;
color: #663;
text-transform: uppercase;
text-decoration: none;
}

div#linkList ul li a:hover {
background-color: #000;
color: #FFF;
}

div#linkList div#lselect ul li, div#lStore ul li {
padding: 5px;
padding-left: 20px;
padding-right: 20px;
font-size: 10px;
}

div#linkList div#lselect ul li a, div#lStore ul li a {
padding: 0;
font-size: 12px;
}

div#linkList div#lselect ul li a:hover, div#lStore ul li a:hover {
color: #000;
background-color: #FFF;
}

div#linkList div#lselect ul li a.c, div#lStore ul li a.c {
display: inline;
text-transform: none;
font-size: 10px;
color: #000;
}

div#linkList div#lselect ul li a.c:hover, div#lStore ul li a.c:hover {
text-decoration: underline;
}

div#linkList div#lselect, div#linkList div#lStore, div#linkList div#lresources {
display: block;
margin-top: 10px;
}

div#linkList div#lselect h3, div#linkList div#lStore h3, div#linkList div#lresources h3 {
display: block;
height: 35px;
width: 100%;
margin: 0;
padding: 0;
}

div#rotate_ad {
display: block;
height: 150;
width: 100%;
margin: 0;
padding: 0;
}

div#linkList div#lselect h3 span, div#linkList div#lStore h3 span, div#linkList div#lresources h3 span {
display: none;
}

div#linkList div#lselect h3 {
background: url(D:\Play\PersonalWebsite\WebContent\IMAGES\PhotoGallery.gif) center top no-repeat;
}

div#linkList div#lstore h3 {
background: url(D:\Play\PersonalWebsite\WebContent\IMAGES\Store.gif) center top no-repeat;
}

div#linkList div#lresources h3 {
background: url(D:\Play\PersonalWebsite\WebContent\IMAGES\Resources.gif) center top no-repeat;
}

felgall
09-19-2008, 06:28 PM
Which browser(s) is it not working in?

IE6 doesn't support position:fixed at all and if anything comes before the <!DOCTYPE at all will go into quirks mode.

JadieGlitch
09-19-2008, 06:30 PM
I'm using IE7. Work doesn't allow anything Mozilla or I'd get FireFox to test out the browser theory.

Maybe someone could try it in FireFox for me??

Centauri
09-19-2008, 11:13 PM
IE7 will also drop into quirks mode if there is anything before the doctype, hence the issues with the comment - don't put anything before the doctype.

We really can't "try" it in FF as we don't have the graphics used - best to provide a live link to it.

felgall
09-20-2008, 12:47 AM
An HTML comment really ought to be IN the HTML and not outside of it - so it should come after the <html> tag in the source. The only things that can come before the <html> tag are an XML header and a doctype neither of which are HTML. IE7 does allow the XML header before the doctype (as modern browsers do) while that perfectly valid code will throw IE6 into quirks mode.

JadieGlitch
09-22-2008, 11:13 AM
Okay, I tried moving the comment around. I was going to submit some screenshots but it doesn't look like this forum supports that...

When I have the comment there, it displays normally... only the left-hand side isn't "fixed". When I remove the comment, nothing will display correctly... but now the left-hand side IS "fixed".

So, if HAVING the comment there is supposed to break it... why is it breaking MORE when the comment is gone? I might have to plead with my boss to allow me to download FireFox (the portable version isn't working with it at all) so that I can test and make SURE it's a browser compatability issue...

Thanks for the help so far... any more advice you can offer would be greatly appreciated ^_^.

Centauri
09-22-2008, 11:29 AM
Just briefly looking through your css, there are a few places where no units have been specified for sizes, and IE may allow this in quirks mode (who knows what IE does in quirks mode?), but not in compliance mode. There are also a few places where a width or height is specified along with padding - in IE quirks mode, the padding will be subtracted from the size but in compliance mode it will be added, and this can make a huge difference to the page rendering.

Without the comment, Firefox will show the page as coded, and once it is fine there, any IE bugs that crop up are mostly well known and documented (sometimes takes a bit to work out which element is invoking which bug though).

JadieGlitch
09-22-2008, 11:55 AM
Thanks for the advice. I'm going through my code right now to see what I can fix. I am still pretty new at this so it's going to take awhile for me to decipher...

I appreciate your help :3