tags:

views:

29

answers:

2

Im designing a printer friendly page and im stuck trying to alter 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; }
+3  A: 

Try explicitly specifying the font properties for the td:

table tr td {
  font-size: 12pt;
  font-family:'Times New Roman',Times,serif;
}
Pekka
@pekka thanks for ur answer but no joy,doesnt make any sense. even if i put 120 pt for font-size it wont have it.
manraj82
@manraj strange. Are you sure the style sheet gets included? Can you try `table { display: none }` to see whether it has any effect at all?
Pekka
@manraj well, you *are* printing the document, right?
Pekka
@pekka my bad,its working now thanks for ur answer mate,it actually helped
manraj82
A: 

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; 
}
Octavian Damiean