sifr 两种颜色
我使用 sifr 作为标题,并想使用不同的颜色突出显示某些单词。
我认为这可以使用 sifr 3 及其对 em 等标签的支持来实现,并找到了一个教程来确认这一点:http://justcoded.com/article/two-colors-sifr3/
不过,我遇到了一个错误,即 em 标记内的文本不可见,并且标题间隔得好像不存在一样根本就在那里。
html:
<h1>Normal Style Here <em>Emphasised here</em> Yet Not here!</h2>
sifr-config.js
sIFR.replace(foundrygridnik, {
selector: 'h1', wmode: 'transparent', forceSingleLine: true,
css: ['.sIFR-root {color: #acd037; }',
'em {color: #ffffff; }']
});
i'm using sifr for headings, and want to highlight certain words using a different colour.
i thought this could be achieved using sifr 3 and its support for tags such as em, and found a tutorial confirming such here: http://justcoded.com/article/two-colors-sifr3/
though, am encountering an error whereby the text within the em tag is not visible and the heading is spaced as though it was not there at all.
html:
<h1>Normal Style Here <em>Emphasised here</em> Yet Not here!</h2>
sifr-config.js
sIFR.replace(foundrygridnik, {
selector: 'h1', wmode: 'transparent', forceSingleLine: true,
css: ['.sIFR-root {color: #acd037; }',
'em {color: #ffffff; }']
});
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
试试这个,只需针对每种情况进行替换调用:
在此处输入代码
sIFR.replace(test, {选择器:'p',
css: '.sIFR-root { 字母间距: .3;前导:0;背景颜色:#e6e6e6;颜色:#79868e;字体大小:15px;文本对齐:对齐;文本缩进:20px; }'
});
sIFR.replace(测试, {
选择器:'h4',
css: '.sIFR-root { 背景颜色: #e6e6e6;颜色:#79868e;字体大小:14px;文本对齐:右对齐; }'
});
Try this, just have a replace call for each situation:
enter code here
sIFR.replace(test, {selector: 'p',
css: '.sIFR-root { letter-spacing: .3; leading: 0; background-color: #e6e6e6; color: #79868e; font-size: 15px; text-align: justify; text-indent: 20px; }'
});
sIFR.replace(test, {
selector: 'h4',
css: '.sIFR-root { background-color: #e6e6e6; color: #79868e; font-size: 14px; text-align: right; }'
});