Here is my code:
<div class='some' style='position: absolute; left: 300; top: 300;'>..</div>
It parses only style='position: absolute'
, and doesn't parse the other styles. How can I achieve this?
HTML style Attribute The style attribute specifies an inline style for an element. The style attribute will override any style set globally, e.g. styles specified in the <style> tag or in an external style sheet.
In Haml, we write a tag by using the percent sign and then the name of the tag. This works for %strong , %div , %body , %html ; any tag you want. Then, after the name of the tag is = , which tells Haml to evaluate Ruby code to the right and then print out the return value as the contents of the tag.
Haml (HTML Abstraction Markup Language) is a templating system that is designed to avoid writing inline code in a web document and make the HTML cleaner. Haml gives the flexibility to have some dynamic content in HTML.
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;" }
No need to use %div
:
.some{ style: 'position: absolute; left: 300px; top: 300px;' }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With