Take the 2-minute tour ×

In yesod, we can specify the class attribute like so:

<div .myclass> ==> <div class="myclass">

Is there an analog for id? For example, something like:

<div #id> ==> <div id="id">
share|improve this question

1 Answer 1

up vote 5 down vote accepted

Yes; it has the exact syntax you guessed.

From the Yesod book:

There are two convenience attributes: for id, you can use the hash, and for classes, the period. In other words, <p #paragraphid .class1 .class2>.

share|improve this answer
Well look at that. It wasn't working for me at first, but that was due to other reasons. Thanks! –  Clark Gaebel Apr 11 '12 at 5:15
Clark, can you please accept @ehird's answer, if that has fixed the issue. Thank you. –  Gangadhar Apr 11 '12 at 5:19
I will. There's a 15 minute timer before I can. –  Clark Gaebel Apr 11 '12 at 5:20

Your Answer


