McMonty
McMonty

Reputation: 85

Can you use haml in an html file?

Does haml code go in the body tags of an html file?

.flex
.intro.animate#microsoft-container
    .logo
        - (1..4).each do
            .box
    .brand
        Microsoft

%iframe.player{:width => 0, :height => 0, :src => 
"https://www.youtube.com/embed/I3Ak5VgyEoc?autoplay=1" }

Upvotes: 1

Views: 2311

Answers (1)

LWilson
LWilson

Reputation: 444

Nope. HAML is a abstraction of HTML. So needs to be converted to HTML before living inside a HTML document.

Here's your HAML converted https://codepen.io/sitrobotsit/pen/MmZBWx

<div class='flex'></div>
<div class='intro animate' id='microsoft-container'>
  <div class='logo'>
    <div class='box'></div>
    <div class='box'></div>
    <div class='box'></div>
    <div class='box'></div>
  </div>
  <div class='brand'>
    Microsoft
  </div>
</div>
<iframe class='player' height='0' src='https://www.youtube.com/embed/I3Ak5VgyEoc?autoplay=1' width='0'></iframe>

If you're working with HAML a lot, you'll want to get a HAML converting locally, see -> http://haml.info/tutorial.html

Upvotes: 1

Related Questions