我的问题是当我将 inline CSS 放在这样的标签中时:
<div style='border : 1.5px solid black; color:red;'>...</div>
This is just an example not the one which causing the issue.
第二个属性,在这里color: red;
, 当我在 PHP 变量中使用它以稍后使用 HTML2PDF 生成 pdf 时,不会被解释。
$content2 = "<html>
<head>
...
</head>
<body>
<h3 style='margin-bottom: 0px;'>".$design."</h3>
<div style='margin: 15px;'> <strong>".$taille."</strong> - <i>".$scient."</i><br /></div>
<div style='border : 1.5px solid black; width:100px;'><img src='".$chemin."' style='width: 100px;' /></div><p style='margin-top : -75px; margin-right : -250px;'>origine :".$origine."</p>
</body>
</html>
";
请帮我解决这个问题。
最佳答案
CSS 使用冒号来定义值。您似乎多次使用等号来定义值。
关于php - 在标签的样式属性中时不解释 CSS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33388407/