...

View Full Version : internet explorer bug, html & css



xSiDx
11-07-2009, 06:55 AM
hi, i have made a webpage, that works fine in Chrome and Firefox, but when I open it in IE7 and 8 it is bugged. There's one tiny line of code that screws it up.. a simple <div style="text-align:left">.

here's my full HTML code;

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Teenagers &amp; The Law</title>
<link rel="stylesheet" type="text/css" href="stylesr-r.css">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.style3 {font-size: 12px; font-family: Arial, Helvetica, sans-serif;}
.style4 {font-family: Arial, Helvetica, sans-serif}
.style5 {font-size: 12px}
.style6 {font-size: 18px}
-->
</style>
</head>
<center>
<div id="container">
<br><br><br><br>
<div id="main">

<div id="navigation">
<table width="100%">
<tr>
<td width="99%"><link rel="stylesheet" type="text/css" href="anylinkmenu.css" />

<script type="text/javascript" src="menucontents.js"></script>

<script type="text/javascript" src="anylinkmenu.js">

/***********************************************
* AnyLink JS Drop Down Menu v2.0- Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Project Page at http://www.dynamicdrive.com/dynamicindex1/dropmenuindex.htm for full source code
***********************************************/

</script>

<script type="text/javascript">

//anylinkmenu.init("menu_anchors_class") //Pass in the CSS class of anchor links (that contain a sub menu)
anylinkmenu.init("menuanchorclass")

</script>
<!--1st anchor link-->

<p align="right"><a class="menuanchorclass style4 style6" rel="anylinkmenu1">Main Menu</a></p>



</td>
<td width="1%" align="right"><font face="Arial"></a></font></td>
</tr>
</table>
</div>

<div id="contentmid">
<div style="text-align:left">
<table width="93%" align="left">
<tr>
<td width="100%">
<p>&nbsp;</p>
<p><font face="Arial" size="6" style="color:#ec14e8">Teenagers &amp; The Law </font><br />
</p>
<p class="style3">From the ages of 14, if charged with a criminal offence, it is not neccessary for the court to prove that the child was aware or his or her actions. If proven guilty, the child will be prosecuted. </p>
<p class="style3">The rights of a teenager in Australia are heavily restricted, and a majority of influence/power lies in the parent(s)/guardian(s), e.g. teenagers and children cannot apply for a passport without Parent or Guardian signature. </p>
<p class="style3">As a teenager, many aspects are restricted, and as teenagers, many rights are taken away and put in the hands of the parent/guardian, e.g. alcohol and cigarettes are restricted from teenagers. Teenagers are also subject to compulsory education, and truancy is punishable by law - repeat offenders are taken to court and given an official warning. </p>
<p class="style3">To work, all teenagers must have a tax file number - even if exempt from taxes; otherwise, the government are able to tax you at various rates as they do not have records of your income. </p>
<p><span class="style3"><strong>Arrest: </strong>as a ciizen of Australia, you do not have the right to resist arrest - resisting arrest is a chargeable offence. However, under arrest, you are not obliged to say anything, as anything you do say, will be written down as evidence and used against you. Citizens no longer have the right to a phone call - however if you ask politely, they may allow it. </span></p>
<p><span class="style4"><span class="style5"><strong>Interogations: </strong>A person in Australia cannot be forced to answer questions - even if posed by the police. This is known as the 'right to silence'.</span></span></p>
<p class="style3"><strong>Fingerprints: </strong>if charged with an offence, that carries a term of imprisonment, it is now mandatory that you, as a citizen, give your fingerprint. If you refuse, police habe the power to use force in order to attain it.</p>
<p class="style3"><strong>Identification Parades: </strong>when suspects are lined up, for the victime or witness to identify the criminal, depending on the seriousness of the crime, you have the right to refuse participation. </p>
<p class="style3"><strong>Searches</strong>: Police have the power to complete a 'frisk' search of the person's body, clothing, car or house if they have reasonable grounds to believe that the law has been broken. </p>
<p class="style3"><strong>Home Search: </strong>Police can only search your home or private property if you consent, or if they have a 'search warrant' from a Magistrate. However, the police can enter your house without permission if an offencer has been committed.</p>
<p class="style3"><strong>Body Samples: </strong>Body samples can only be taken with your consent, or with court order. Samples may include: hair, saliva, dental impressions, body fluids or blood. These samples are taken from the suspect and comparred with the sample found at the scene of the crime to confirm guilt or innocence. </p>
</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
</table>
</div>
<div id="contentbot">
<div style="text-align:left">
<table width="50%" align="left">
<tr>
<td width="50%"><p><br />
<font face="Arial" size="6" style="color:#ec14e8">Reporting a Crime </font></p>
<p class="style3">When reporting a crime, the following steps are important;</p>
<ol>
<li class="style3"> Write down the facts as soon as possible - while it is still fresh in your mind. </li>
<li class="style3"> Include a description of people involved, age, nationality, gender, etc.</li>
<li class="style3"> Include essential information, colour and make of a car, number plates etc.</li>
<li class="style3"> Make a summary of the event you witnessed.</li>
<li class="style3"> Contact the police quickly with this information. </li>
</ol>
<p>&nbsp;</p>
<p><br />
</p></td>
</tr>
</table>
<table width="50%" align="right">
<tr>
<td width="50%"><p>&nbsp;</p>
<p><img src="images/crime.jpg" width="250" height="250"></p></td>
</tr>
</table></div>

</div><div id="footer"></div>

</div> <!-- This is closing that "container" DIV that we created at the top -->
</center>
</body>
</html>

CSS code:

/* CSS Document */
/*Uprising Tokyo*/
A:link {
color:#FFFFFF;
text-decoration:none;
}
A:visited {
color:#FFFFFF;
text-decoration:none;
}
A:active {
color:#FFFFFF;
text-decoration:none;
}
A:hover {
color:#FF00FF;
text-decoration:none;
}
body {
background-color: #ec14e8;
background-image: url();
background-repeat: no-repeat;
margin-top: 0px;
margin-left: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
#container {
margin:auto;
width:auto;
background:url(images/background.png) center no-repeat;
background-position:top;
}
#logo {
width:800px;
font-size:12px;
font:arial;
padding-top:34px;
padding-left:100px;
color:#FFFFFF;
}
#navigation {
width:744px;
font-size:12px;
padding-top:30px;
padding-left:35px;
padding-right:30px;
color:#FFFFFF;
}
#contentmid {
width:800px;
font-size:11px;
padding-left:30px;
padding-right:30px;
color:#FFFFFF;
}
#contentbot {
width:794px;
font-size:11px;
padding-top:200px;
padding-left:30px;
padding-right:30px;
color:#FFFFFF;
}
#main {
width:800px;
height:900px;
background:url(images/testbg.png) center repeat-y;
}
#footer {
clear:both;
width:auto;
height:100px;
}


screenshots:
this is with that line;
http://img262.imageshack.us/i/29309615.png/
http://img265.imageshack.us/i/25964097.png/
http://img337.imageshack.us/i/53981299.png/

this is without that line. as you can see, the text aligns to center without it. but i want it on the left.
http://img44.imageshack.us/i/38679062.png/

the bottom image, is how i want it to be, but with the text aligned to the left.

cheers in advance!!

abduraooft
11-07-2009, 08:41 AM
I'd recommend your to practice standard coding. For that, change your DOCTYPE to a Strict one,
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> and then validate your code and remove all deprecated tags and attributes.

xSiDx
11-07-2009, 09:54 AM
can you please elaborate? I'm not much of an expert on HTML.

abduraooft
11-07-2009, 10:01 AM
Your current DOCTYPE at the top of your document is
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">. Replace it with the one given above and validate your markup using http://validator.w3.org/#validate_by_input for finding the errors in it.

xSiDx
11-07-2009, 10:24 AM
no luck, the error still remains.

abduraooft
11-07-2009, 10:41 AM
Have you fixed the errors in your markup, given by the validator? If so, please post your current code.

xSiDx
11-07-2009, 11:50 AM
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Teenagers &amp; The Law</title>
<link rel="stylesheet" type="text/css" href="stylesr-r.css">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.style3 {font-size: 12px; font-family: Arial, Helvetica, sans-serif;}
.style4 {font-family: Arial, Helvetica, sans-serif}
.style5 {font-size: 12px}
.style6 {font-size: 18px}
-->
</style>
</head>
<center>
<div id="container">
<br><br><br><br>
<div id="main">

<div id="navigation">
<table width="100%">
<tr>
<td width="99%"><link rel="stylesheet" type="text/css" href="anylinkmenu.css">

<script type="text/javascript" src="menucontents.js"></script>

<script type="text/javascript" src="anylinkmenu.js">

/***********************************************
* AnyLink JS Drop Down Menu v2.0- Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Project Page at http://www.dynamicdrive.com/dynamicindex1/dropmenuindex.htm for full source code
***********************************************/

</script>

<script type="text/javascript">

//anylinkmenu.init("menu_anchors_class") //Pass in the CSS class of anchor links (that contain a sub menu)
anylinkmenu.init("menuanchorclass")

</script>
<!--1st anchor link-->

<p align="right"><a class="menuanchorclass style4 style6" rel="anylinkmenu1">Main Menu</a></p>



</td>
<td width="1%" align="right"><font face="Arial"></font></td>
</tr>
</table>
</div>

<div id="contentmid">
<div style="text-align:left">
<table width="93%" align="left">
<tr>
<td width="100%">
<p>&nbsp;</p>
<p><font face="Arial" size="6" style="color:#ec14e8">Teenagers &amp; The Law </font><br>
</p>
<p class="style3">From the ages of 14, if charged with a criminal offence, it is not neccessary for the court to prove that the child was aware or his or her actions. If proven guilty, the child will be prosecuted. </p>
<p class="style3">The rights of a teenager in Australia are heavily restricted, and a majority of influence/power lies in the parent(s)/guardian(s), e.g. teenagers and children cannot apply for a passport without Parent or Guardian signature. </p>
<p class="style3">As a teenager, many aspects are restricted, and as teenagers, many rights are taken away and put in the hands of the parent/guardian, e.g. alcohol and cigarettes are restricted from teenagers. Teenagers are also subject to compulsory education, and truancy is punishable by law - repeat offenders are taken to court and given an official warning. </p>
<p class="style3">To work, all teenagers must have a tax file number - even if exempt from taxes; otherwise, the government are able to tax you at various rates as they do not have records of your income. </p>
<p><span class="style3"><strong>Arrest: </strong>as a ciizen of Australia, you do not have the right to resist arrest - resisting arrest is a chargeable offence. However, under arrest, you are not obliged to say anything, as anything you do say, will be written down as evidence and used against you. Citizens no longer have the right to a phone call - however if you ask politely, they may allow it. </span></p>
<p><span class="style4"><span class="style5"><strong>Interogations: </strong>A person in Australia cannot be forced to answer questions - even if posed by the police. This is known as the 'right to silence'.</span></span></p>
<p class="style3"><strong>Fingerprints: </strong>if charged with an offence, that carries a term of imprisonment, it is now mandatory that you, as a citizen, give your fingerprint. If you refuse, police habe the power to use force in order to attain it.</p>
<p class="style3"><strong>Identification Parades: </strong>when suspects are lined up, for the victime or witness to identify the criminal, depending on the seriousness of the crime, you have the right to refuse participation. </p>
<p class="style3"><strong>Searches</strong>: Police have the power to complete a 'frisk' search of the person's body, clothing, car or house if they have reasonable grounds to believe that the law has been broken. </p>
<p class="style3"><strong>Home Search: </strong>Police can only search your home or private property if you consent, or if they have a 'search warrant' from a Magistrate. However, the police can enter your house without permission if an offencer has been committed.</p>
<p class="style3"><strong>Body Samples: </strong>Body samples can only be taken with your consent, or with court order. Samples may include: hair, saliva, dental impressions, body fluids or blood. These samples are taken from the suspect and comparred with the sample found at the scene of the crime to confirm guilt or innocence. </p>
</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
</table>
</div>
<div id="contentbot">
<div style="text-align:left">
<table width="50%" align="left">
<tr>
<td width="50%"><p><br>
<font face="Arial" size="6" style="color:#ec14e8">Reporting a Crime </font></p>
<p class="style3">When reporting a crime, the following steps are important;</p>
<ol>
<li class="style3"> Write down the facts as soon as possible - while it is still fresh in your mind. </li>
<li class="style3"> Include a description of people involved, age, nationality, gender, etc.</li>
<li class="style3"> Include essential information, colour and make of a car, number plates etc.</li>
<li class="style3"> Make a summary of the event you witnessed.</li>
<li class="style3"> Contact the police quickly with this information. </li>
</ol>
<p>&nbsp;</p>
<p><br>
</p></td>
</tr>
</table>
<table width="50%" align="right">
<tr>
<td width="50%"><p>&nbsp;</p>
<p><img src="images/crime.jpg" width="250" height="250"></p></td>
</tr>
</table></div>

</div><div id="footer"></div>

</div> <!-- This is closing that "container" DIV that we created at the top -->
</center>
</html>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum