将样式属性迁移到单独的 .css 文件
Migrating style properties to separated .css file
尊敬的社区成员,
我需要把所有的:
style="display:none"
来自所有行:
<p class="text" style="display:none">
到以下样式表:
style.css
在 http://berdyanskaya56.ru/index.html.
值得注意的是,如果我移动
"display:none"
到
.text
在
style.css
描述性标题不会分别更改为图片在页面上滑动(即在网站屏幕两侧使用箭头)。
最后说明:
我需要删除所有
style="display:none"
来自
<p class="text" style="display:none">
到
.text
在
style.css.
这将极大地帮助我清理网站上的代码。进行更改后,html 页面中的 <p>
标记将如下所示:
<p class="text">
如果需要进一步说明,请在post 下方post 评论。
非常感谢您的提前帮助!
更新:它还需要更改 JS 中控制 display:none 的功能。如果你能帮助我,请在下面 post :-)!
/* style.css */
/* set all `p` elements having `class` `"text"`
`display` property to `none`
*/
p.text {
display:none;
}
只需熟悉 CSS 的基础知识即可。
在您的情况下,您已经为所有相关对象设置了 class "text"。
您的CSS-文件将包含类似
的内容
.text {
display: none;
}
编辑:
您还需要 link 将 CSS 文件添加到您的文档中的 head-tag:
<link rel="stylesheet" type="text/css" href="mystyle.css" />
以下是一些基础知识:http://www.w3schools.com/css/css_howto.asp
要更改文本,您必须在箭头中添加一些 javascript,以正确的方式设置显示属性:
document.getElementById("<the id of the current text>").display = "none";
document.getElementById("<the id of the next text>").display = "inline";
有关通过 JS 操作 CSS 的更多信息,请查看此处:http://www.w3schools.com/js/js_htmldom_css.asp
尊敬的社区成员,
我需要把所有的:
style="display:none"
来自所有行:
<p class="text" style="display:none">
到以下样式表:
style.css
在 http://berdyanskaya56.ru/index.html.
值得注意的是,如果我移动
"display:none"
到
.text
在
style.css
描述性标题不会分别更改为图片在页面上滑动(即在网站屏幕两侧使用箭头)。
最后说明:
我需要删除所有
style="display:none"
来自
<p class="text" style="display:none">
到
.text
在
style.css.
这将极大地帮助我清理网站上的代码。进行更改后,html 页面中的 <p>
标记将如下所示:
<p class="text">
如果需要进一步说明,请在post 下方post 评论。
非常感谢您的提前帮助!
更新:它还需要更改 JS 中控制 display:none 的功能。如果你能帮助我,请在下面 post :-)!
/* style.css */
/* set all `p` elements having `class` `"text"`
`display` property to `none`
*/
p.text {
display:none;
}
只需熟悉 CSS 的基础知识即可。 在您的情况下,您已经为所有相关对象设置了 class "text"。
您的CSS-文件将包含类似
的内容.text {
display: none;
}
编辑:
您还需要 link 将 CSS 文件添加到您的文档中的 head-tag:
<link rel="stylesheet" type="text/css" href="mystyle.css" />
以下是一些基础知识:http://www.w3schools.com/css/css_howto.asp
要更改文本,您必须在箭头中添加一些 javascript,以正确的方式设置显示属性:
document.getElementById("<the id of the current text>").display = "none";
document.getElementById("<the id of the next text>").display = "inline";
有关通过 JS 操作 CSS 的更多信息,请查看此处:http://www.w3schools.com/js/js_htmldom_css.asp