如何在HAML中为元素设置内联样式 [英] How to set inline style for element in HAML
本文介绍了如何在HAML中为元素设置内联样式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这是我的代码:
<div class='some' style='position: absolute; left: 300; top: 300;'>..</div>
它仅解析style='position: absolute'
,不解析其他样式.我怎样才能做到这一点?
It parses only style='position: absolute'
, and doesn't parse the other styles. How can I achieve this?
推荐答案
如果您发布了正在使用的HAML,这会很方便,但这是这样做的:
It would have been handy if you'd posted the HAML you're using, but this is how it's done:
%div.some{ :style => "position: absolute; left: 300px; top: 300px;" }
这篇关于如何在HAML中为元素设置内联样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文