Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/277.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
Php 如何根据浏览器版本给出条件cellpadding值?_Php_Html_Css - Fatal编程技术网

Php 如何根据浏览器版本给出条件cellpadding值?

Php 如何根据浏览器版本给出条件cellpadding值?,php,html,css,Php,Html,Css,如何根据浏览器版本提供有条件的cellpading?例如: 对于IE7,我想给出cellpadding=200,对于其他浏览器,我想给出100 我可以用PHP实现它吗 如果是,如何实现这一点 <table class="popup" id="nameFieldPopup" border="0" cellpadding="100" > 但它不起作用。提前谢谢。 <!--[if !IE]> --> <link type="text/css" rel="st

如何根据浏览器版本提供有条件的
cellpading
?例如:

对于IE7,我想给出
cellpadding=200
,对于其他浏览器,我想给出100

我可以用PHP实现它吗

如果是,如何实现这一点

<table  class="popup"  id="nameFieldPopup" border="0" cellpadding="100" >
但它不起作用。提前谢谢。


 <!--[if !IE]> -->
<link type="text/css" rel="stylesheet" href="css/my_style.css">
<!-- <![endif]-->

把它放在你的html文件中

我认为条件注释在CSS文件中不起作用

您可以在HTML文件中使用条件注释,以便加载单独的CSS文件:


尝试IE特定的css规则。为了控制CSS中的“单元格填充”,您可以简单地对表格单元格使用填充

table#nameFieldPopup tr td { 
    padding: 100px; /* standard */
    *padding: 200px; /* IE 7 and below */
}

对不起,这是一个打字错误,我的问题仍然存在。
<!--[if IE 7]> <link rel="stylesheet" href="ie7.css" /><![endif]-->
.popup td {
    padding: 200px; /*200 for IE7 as in your example*/
}
table#nameFieldPopup tr td { 
    padding: 100px; /* standard */
    *padding: 200px; /* IE 7 and below */
}