Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/73.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/40.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html css打印字体不变_Html_Css - Fatal编程技术网

Html css打印字体不变

Html css打印字体不变,html,css,Html,Css,我正在设计一个打印机友好的页面,我一直在试图改变CSS中的字体属性[font size,font family]。我不知道我做错了什么。我在CSS文件中为body标记指定的字体属性似乎根本不起作用 有人能给我解释一下我做错了什么吗 html 尝试显式指定td的字体属性: table tr td { font-size: 12pt; font-family:'Times New Roman',Times,serif; } 试试这个CSS #wrapper { margin-left:

我正在设计一个打印机友好的页面,我一直在试图改变CSS中的字体属性[font size,font family]。我不知道我做错了什么。我在CSS文件中为body标记指定的字体属性似乎根本不起作用

有人能给我解释一下我做错了什么吗

html


尝试显式指定
td
的字体属性:

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

#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; 
}

谢谢你的回答,但是没有快乐,没有任何意义。即使我把字体大小设为120磅,它也不会有。@manraj奇怪。您确定包含样式表吗?你能试试
表{display:none}
看看它是否有任何效果吗?我的错,它现在工作了,谢谢你的回答,它实际上帮助了我,似乎对我很好。你确定你的CSS链接正确吗?我所做的测试就是如上所述创建文件,并将字体系列更改为Arial,以查看它是否更改为打印版本,并且效果良好。真的,这太令人沮丧了!!我以前看过这项工作,但现在无法工作…我很抱歉,伙计,但你能不能帮我发代码,只是想看看你是否做了什么不同的事情
table tr td {
  font-size: 12pt;
  font-family:'Times New Roman',Times,serif;
}
#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; 
}