...

View Full Version : Wrong Color



zda2
03-23-2012, 07:34 PM
I am using an external style sheet to set the color of my calculator to gray. However, when I open my javascript in Google Chrome, the calculator is red. I've checked the style sheet code and it's correct. Can anyone tell me why this is happening? I posted both the html and css code below.



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Calculator</title>
<link rel="stylesheet" type="text/css" href="assignment2.css" />
<div align="center">
<script type="text/javascript">
var title = "<strong>Calculator</br> Aughtman, Zackary</strong>"
document.write(title.fontsize(5));
</script>
</div>
</head>

<body>
</br>
</br>
<div align="center">
<table align = "center" border="1" bordercolor="div1" bgcolor="div2">
<tr>
<td colspan="4">
<input type="text" value="" id="results" class="results" />
</td>
</tr>
<tr>
<td>
<input type="button" style="width:30px" value="7" onclick="EnterNumber(this.value)">
</td>
<td>
<input type="button" style="width:30px" value="8" onclick="EnterNumber(this.value)">
</td>
<td>
<input type="button" style="width:30px" value="9" onclick="EnterNumber(this.value)">
</td>
<td>
<input type="button" style="width:30px" value="/" onclick="EnterOperator(this.value)">
</td>
</tr>
<tr>
<td>
<input type="button" style="width:30px" value="4" onclick="EnterNumber(this.value)">
</td>
<td>
<input type="button" style="width:30px" value="5" onclick="EnterNumber(this.value)">
</td>
<td>
<input type="button" style="width:30px" value="6" onclick="EnterNumber(this.value)">
</td>
<td>
<input type="button" style="width:30px" value="*" onclick="EnterOperator(this.value)">
</td>
</tr>
<tr>
<td>
<input type="button" style="width:30px" value="1" onclick="EnterNumber(this.value)">
</td>
<td>
<input type="button" style="width:30px" value="2" onclick="EnterNumber(this.value)">
</td>
<td>
<input type="button" style="width:30px" value="3" onclick="EnterNumber(this.value)">
</td>
<td>
<input type="button" style="width:30px" value="-" onclick="EnterOperator(this.value)">
</td>
</tr>
<tr>
<td>
<input type="button" style="width:30px" value="0" onclick="EnterNumber(this.value)">
</td>
<td>
<input type="button" style="width:30px" value="N" onclick="EnterNumber(this.value)">
</td>
<td>
<input type="button" style="width:30px" value="L" onclick="EnterNumber(this.value)">
</td>
<td>
<input type="button" style="width:30px" value="+" onclick="EnterOperator(this.value)">
</td>
</tr>
<tr>
<td>
<input type="button" style="width:30px" value="" onclick="EnterNumber(this.value)">
</td>
<td>
<input type="button" style="width:30px" value="" onclick="EnterNumber(this.value)">
</td>
<td>
<input type="button" style="width:30px" value="=" onclick="EnterNumber(this.value)">
</td>
<td>
<input type="button" style="width:30px" value="C" onclick="EnterOperator(this.value)">
</td>
</tr>
</table>
</br>
<script type="text/javascript">
document.write("<strong>Instructions</strong></br>");
document.write("Click a number, then an action, then another number, then the equals button.</br>");
document.write("Press C when ready to start over.</br>");
document.write("The N button makes your previous number a negative.</br>");
document.write("The L button requires one number to be available,</br>");
document.write("it will loop through that numberto ten plus that number</br>");
document.write("and add all values and display.</br>");
document.write("For example: 1+2+3+4+5+6+7+8+9+10=55</br></br>");
document.write("<strong>Navigator Info</strong></br>");
document.write("App Name: Netscape</br>");
document.write("Cookes Enable: true</br>");
document.write("User agent Mozilla 5.0 Windows NT 5.1; rv:6.0 Gecko 20100101 Firefox 6.0</br>");
</script>
</div>
</body>
</html>





#div1 {color:#999999}
#div2 {color:#999999}

xelawho
03-23-2012, 07:52 PM
give your table an id and reference it properly in your css:



#mytable {border-color:#0000FF;
background-color:#808080;
}

<table align = "center" border="1" id="mytable">

zda2
03-23-2012, 08:26 PM
Thank you so much! I have the right color!!!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum