样式化sIFR 3时,我应该何时使用JavaScript / CSS / Flash?

时间:2022-09-10 23:18:41

I'm using sifr for the first time today. I have it up and running; however, I need some help. Rather than explain, I'll show you the code below:

我今天第一次使用sifr。我把它弄好了;但是,我需要一些帮助。我将向您展示以下代码,而不是解释:

<div id="pullquote">“Fantastic property, facilities and location. We
      couldn’t have asked for more!” <em>Mr &amp; Mrs. Smith</em></div>

So far, so good. I have then styled that in the same document in case flash/JavaScript is disabled. No problem.

到现在为止还挺好。然后我在相同的文档中设置样式,以防Flash / JavaScript被禁用。没问题。

sIFR.replace(journal, {
  selector: 'div#pullquote',
  wmode: 'transparent',
  css: [
    '.sIFR-root { text-align: center; color: #be7705; font-size: 30px; background-color:#fdefd4; }',
    'em { font-style: normal; color: #1d5d69; font-size: 26px; }']
});

That's what is included in my JavaScript file. Am I correct in styling the element like this? I got slightly confused with the selector, then using a second selector within js-css. Once again, there is also sifr.css. What should be included in this document? Should I be styling the element here?

这就是我的JavaScript文件中包含的内容。我是否正确设计了这样的元素?我对选择器稍微感到困惑,然后在js-css中使用第二个选择器。再一次,还有sifr.css。本文档应包含哪些内容?我应该在这里设计元素吗?

I suppose my question is: What should be included, and what styling should be done in sifr-config.js and what styling should be done in sifr.css?

我想我的问题是:应该包含哪些内容,以及在sifr-config.js中应该做什么样的样式以及在sifr.css中应该做什么样的样式?

Thank you :)

谢谢 :)

1 个解决方案

#1


In the CSS for the HTML page (sifr.css) you can add a style to hide the elements that sIFR will replace before does so, and you can do some tuning of the text so the text size maps better to the Flash font.

在HTML页面的CSS(sifr.css)中,您可以添加样式以隐藏sIFR将在此之前替换的元素,并且您可以对文本进行一些调整,以使文本大小更好地映射到Flash字体。

The selector parameter for sIFR.replace() is used to select the elements you wish to replace by sIFR.

sIFR.replace()的selector参数用于选择要由sIFR替换的元素。

The css parameter contains the CSS used inside the Flash movie. At this point, all CSS selectors are relative to the element you replaced, so if you replace an h1#foo, then you select em rather than h1#foo em. This is the only place you can style the text inside the Flash movie, aside from font size, which, if not specified here, is derived from the font size of the replaced element.

css参数包含Flash影片中使用的CSS。此时,所有CSS选择器都与您替换的元素相关,因此如果替换h1#foo,则选择em而不是h1#foo em。除了字体大小之外,这是唯一可以在Flash影片中设置文本样式的地方,如果未在此处指定,则字体大小是从替换元素的字体大小派生的。

#1


In the CSS for the HTML page (sifr.css) you can add a style to hide the elements that sIFR will replace before does so, and you can do some tuning of the text so the text size maps better to the Flash font.

在HTML页面的CSS(sifr.css)中,您可以添加样式以隐藏sIFR将在此之前替换的元素,并且您可以对文本进行一些调整,以使文本大小更好地映射到Flash字体。

The selector parameter for sIFR.replace() is used to select the elements you wish to replace by sIFR.

sIFR.replace()的selector参数用于选择要由sIFR替换的元素。

The css parameter contains the CSS used inside the Flash movie. At this point, all CSS selectors are relative to the element you replaced, so if you replace an h1#foo, then you select em rather than h1#foo em. This is the only place you can style the text inside the Flash movie, aside from font size, which, if not specified here, is derived from the font size of the replaced element.

css参数包含Flash影片中使用的CSS。此时,所有CSS选择器都与您替换的元素相关,因此如果替换h1#foo,则选择em而不是h1#foo em。除了字体大小之外,这是唯一可以在Flash影片中设置文本样式的地方,如果未在此处指定,则字体大小是从替换元素的字体大小派生的。