当 Lift 使用 CSS 类用于其自身目的时,如何使用 CSS 来设计由 Lift 提供的网页样式?

发布于 2024-12-09 11:33:35 字数 103 浏览 4 评论 0原文

Lift 框架似乎在 HTML 标签中使用 class="lift:something" 但如果我想将一些普通的 CSS 应用于此标签并希望它有一个普通的类名怎么办?

Lift framework seems to use class="lift:something" in HTML tags but what if I want to apply some ordinary CSS to this tag and want it to have an ordinary class name?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

泪痕残 2024-12-16 11:33:35

每个 HTML 元素可以有多个由空格分隔的类,例如,

<div class="lift:something something-else"></div>

您可以在样式表中定位这些类中的一个或多个。

如果 Lift 不允许您将自己的类应用于元素(我不是 Scala 程序员),您可能需要将类应用于其他元素,例如包装器 div,并根据那些:

<div class="something">
    <div class="lift:something"></div>
</div>

Each HTML element can have multiple classes separated by spaces, e.g.

<div class="lift:something something-else"></div>

You can target one or more of those classes in your stylesheet.

If Lift doesn't let you apply your own classes to elements (I'm not a Scala programmer), you may need to apply classes to other elements instead, like wrapper divs, and select based on those:

<div class="something">
    <div class="lift:something"></div>
</div>
十二 2024-12-16 11:33:35

你可以在 dom 元素中使用许多类:

<div class="lift:something my_extra_css_class">

或者,如果样式是唯一的,你可以使用 id 并设置 id 的样式,而不是类:

html:
<div class="lift:something" id='my_id'>

css:
#my_id{
  bla: blabla;
  foo: bar;
  fruit: banana;
  codfish: sausage;
  car: garage;
  cash: atm;
}

you can use many classes in dom elements:

<div class="lift:something my_extra_css_class">

Or, if the styling is meant to be unique, you can use an id and style the id and not the class:

html:
<div class="lift:something" id='my_id'>

css:
#my_id{
  bla: blabla;
  foo: bar;
  fruit: banana;
  codfish: sausage;
  car: garage;
  cash: atm;
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文