简体   繁体   English

yesod 中的 id 属性

[英]id property in yesod

In yesod, we can specify the class attribute like so:在 yesod 中,我们可以像这样指定 class 属性:

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

Is there an analog for id? id 有模拟吗? For example, something like:例如,像这样的东西:

<div #id> ==> <div id="id">

Yes;是的; it has the exact syntax you guessed.它具有您猜到的确切语法。

From the Yesod book :来自Yesod 书

There are two convenience attributes: for id, you can use the hash, and for classes, the period.有两个方便的属性:对于 id,可以使用 hash,对于 classes,可以使用句点。 In other words, <p #paragraphid.class1.class2>.换句话说,<p #paragraphid.class1.class2>。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM