有人可以帮助解决这个小问题。我已经尝试将引导类img-responsive添加到存储在数据库中但没有运气的图像中。
以下是我现有的代码......
<?php
if(trim($modelQ['illustration'] != "")){
print "<img src=\"illustrations/{$modelQ['illustration']}\" width=\"558\"/>";
} elseif(trim($modelQ['bosal_img'] != "")){
print "<img src=\"illustrations/bosal/{$modelQ['bosal_img']}\" width=\"558\"/>";
}
?>
答案 0 :(得分:0)
添加类似这样的课程
<?php
if(trim($modelQ['illustration'] != "")) {
print "<img class="nameofyourclass" src=\"illustrations/{$modelQ['illustration']}\" width=\"558\"/>";
} elseif(trim($modelQ['bosal_img'] != "")){
print "<img class="nameofyourclass" src=\"illustrations/bosal/{$modelQ['bosal_img']}\" width=\"558\"/>";
}
?>
然后你可以做
img.nameofyourclass{
//your css
}
或者您可以将打印件封装在div中......
.classofthediv img{
//your css
}