Maison  >  Article  >  interface Web  >  怎么说呢?应该说是样式问题吧,帮看看谢谢_html/css_WEB-ITnose

怎么说呢?应该说是样式问题吧,帮看看谢谢_html/css_WEB-ITnose

WBOY
WBOYoriginal
2016-06-24 11:47:50843parcourir

body{	font-family: "宋体", Verdana, Arial;	font-size: 12px;	margin: 0px;	background: #CED7F7;}.table_border{	border:solid 1px #C4CCD6;	background-color:#FFFFFF;}th{		font-weight:bold;	font:12px;	background-image:url(admin_bg_1.gif);	background-repeat:repeat-x;	color:white;	background-color:4455AA;	height:25px;}td{	font:"宋体" 12px;	line-height: 20px;	line-height: 150%;	table-layout: fixed;}input{	border:#7F9DB9 solid 1px;	background: #FFF;	font-size:12px;}span.tip{	font-size:12px;	position:static;}

<!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=gb2312" /><title>无标题文档</title><link rel="stylesheet" type="text/css" href="style.css"><script src="jquery-1.7.2.js" type="text/javascript"></script><style type="text/css">.even{	background-color:#E4EDF9;}.odd{	background-color:#FFFFFF;}</style><script type="text/javascript">$(document).ready(function(){ //隔行表色 $("tr:even").addClass("even"); $("tr:odd").addClass("odd");   });</script><body>	<form id="form1" runat="server">    <table align="center" cellpadding="1" cellspacing="1" class="table_border" width="98%">        <tr height="22" align="center">            <td align="left" class="forumRow" width="40%">                当前位置:设置            </td>        </tr>    </table>		<br />	<table width="98%" border="0" cellpadding="5" cellspacing="0" align="center" class="table_border">		<tr>			<th colspan="2" valign="middle">设置</th>		</tr>		<tr>			<td align="right" width="40%">文件名称:</td>			<td align="left" width="60%"><input type="text"></td>		</tr>		<tr>			<td align="right" width="40%">文件路径:</td>			<td align="left" width="60%"><input type="text"></td>		</tr>				<tr>			<td align="right" width="40%">图片路径:</td>			<td align="left" width="60%"><input type="text"></td>		</tr>	</table>	</form></body></html>


背景图片高度够的

就想知道多出来的10是怎么来的
愣是找不出问题来



回复讨论(解决方案)

应该是浏览器默认的padding, margin的原因。
你开始并没有重置样式表。
tr, th{
   margin: 0;
   padding: 0;
}
另外,前端样式调试,免不了要用firebug之类的工具,熟悉一下吧。

应该是浏览器默认的padding, margin的原因。
你开始并没有重置样式表。
tr, th{
   margin: 0;
   padding: 0;
}
另外,前端样式调试,免不了要用firebug之类的工具,熟悉一下吧。


这个还真没用过firebug之类的工具~是否还有其他工具
还有为什么不加
tr, th{
   margin: 0;
   padding: 0;
}
默认就不是0了吗?

th元素默认是 padding:5px;
你重新设置下
th
{
font-weight:bold;
font:12px;
background-image:url(admin_bg_1.gif);
background-repeat:repeat-x;
color:white;
background-color:4455AA;
height:25px;
padding: 0px;
}

结贴了~知道了

Déclaration:
Le contenu de cet article est volontairement contribué par les internautes et les droits d'auteur appartiennent à l'auteur original. Ce site n'assume aucune responsabilité légale correspondante. Si vous trouvez un contenu suspecté de plagiat ou de contrefaçon, veuillez contacter admin@php.cn