开发者

css print font not changing

Im designing a printer friendly page and im stuck trying to alt开发者_如何学JAVAer the font properties[font-size, font-family] in CSS.I have got no idea what im doing wrong here. The font properties i have specified for the body tag in the CSS file doesn't seem to work at all.

Could somone please explain to me what im doing wrong here ?

html

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 <html>
  <head>
   <title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" media="print" href="print.css">
</head>

<body>
<div id="wrapper">
    <table width="100%" border="1">
        <tr >
            <td >Job No</td>
            <td>4589</td>
        </tr>
        <tr>
            <td>Job No</td>
            <td>6578</td>
        </tr>
    </table>
</div>
</body>
</html>

css

/* CSS Document */
div#wrapper 
{
    margin-left:auto;
    margin-right:auto;
    width:auto;

}
body {
background-color: transparent;
font-size: 12pt;
font-family:'Times New Roman',Times,serif;
color:#000000; }


Try explicitly specifying the font properties for the td:

table tr td {
  font-size: 12pt;
  font-family:'Times New Roman',Times,serif;
}


Try this CSS instead.

#wrapper
{
  margin-left:auto;
  margin-right:auto;
  width:auto;
}

#wrapper table
{
  font-family:"Times New Roman", Times, serif;
  font-size: 12pt;
}

body 
{
  background-color: transparent;
  font-family:"Times New Roman", Times, serif;
  font-size: 12pt;
  color:#000000; 
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜