在写aspx文件时如果少了 下面的dtd 将无法调用CSS文件中的样式.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
应该写成:
Code
<%@ Page Language="C#" EnableEventValidation="false" AutoEventWireup="true" CodeBehind="AssetList.aspx.cs" Inherits="AssetsManager.DeskWeb.ImportList" %>
<!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 runat="server">
<title>单</title>
<link href="http://www.cnblogs.com/MyCSS/Stylesheet1.css" rel="stylesheet" type="text/css" />
css文件
Code
body
{
/*background-color: #cbedff;*/ /*background-color: #F1F1F1; LightBlue #add8e6*/
font-size: 12px;
color: Black;
font-family: 宋体;
}
/*改变table的连框的粗细,颜色*/
.tb
td {border:#D4D0C8 solid 1px;}
table {border-collapse:collapse;}
font
{
font-size: 12px;
color: Black;
font-family: 宋体;
}
.tb2
td {border:#D4D0C8 solid 0px;}
table {border-collapse:collapse;}
.background
{
background-color: #add8e6;
}