1. 程式人生 > >HTML學習:計算器-表格版+CSS

HTML學習:計算器-表格版+CSS

<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>計算器-表格版+css</title>
		<style>
			td{
				font-size: 30px;
			}
			table{
				width: 35%;
				margin: 0 auto;
			}
			.classtr{
				text-align: center;
				background-color: deepskyblue;
			}
			.classtd{
				width: 25%;
			}
			.classbg{
				background-color: dimgray;
			}
			#inner{
				border: 1px solid red;
				height: 99.5%;
			}
		</style>
	</head>
	<body>
		<table height="90px" cellspacing="0" class="classbg">
			<tr>
				<td>
					&nbsp;&nbsp;&nbsp;&nbsp;<font style="color:red">●
					<font style="color: blue">●
					<font style="color:yellow">●
				</td>
			</tr>			
			<tr>
				<td height="50px" >
					<table style="width: 99%;" cellspacing="0" id="inner">
						<tr>
							<td bgcolor="white"></td>
						</tr>
					</table>
				</td>
			</tr>
		</table>
		<table  cellspacing="5" height="450px" class="classbg">
			<tr class="classtr">
				<td class="classtd">AC</td>
				<td class="classtd">+/-</td>
				<td class="classtd">%</td>
				<td>&divide;</td>
			</tr>
			<tr class="classtr">
				<td>7</td>
				<td>8</td>
				<td>9</td>
				<td>&times;</td>
			</tr>
			<tr class="classtr">
				<td >4</td>
				<td>5</td>
				<td> 6</td>
				<td>-</td>
			</tr>
			<tr class="classtr">
				<td>1</td>
				<td>2</td>
				<td>3</td>
				<td>+</td>
			</tr>
			<tr class="classtr">
				<td>0</td>
				<td>&lt;-</td>
				<td>.</td>
				<td>=</td>
			</tr>
		</table>
	</body>
</html>