我想问如何使用perl cgi在中心打印我的图像这是我的代码:
print img({src=>"/image.png",width=>"200px",hight=>"100px"}),
我尝试了:
print img({-align=>CENTER}, {src=>"/image.png",width=>"200px",hight=>"100px"}),
但是它不起作用
这更像是HTML/CSS问题。使用文本空间中心查看中心图像? - 在此处应用:
print img({style=>"display:block;margin: 0 auto;",
src=>"/image.png",width=>"200px",height=>"100px"});
或使用CSS类,然后将class=>"classname"
放在哈希Rref中而不是style
。