style样式是css还是,认识wordpress主题的主样式表(style.css)

摘要:style.css是每个WordPress主题所需的样式表(CSS)文件。 它控制网页的演示(视觉设计和布局)。

style.css是每个WordPress主题所需的样式表(CSS)文件。 它控制网页的演示(视觉设计和布局)。

位置

为了使WordPress将主题模板文件的集合识别为有效的主题,style.css文件需要位于主题的根目录中,而不是子目录。

有关如何将style.css文件包含在主题中的更详细说明,请参阅“启动脚本和样式”的“样式表”部分。

基本结构

WordPress使用style.css的标题注释部分在“外观(主题)”仪表板面板中显示有关主题的信息。

示例

这是style.css的头部分的一个例子。

/*

Theme Name: Twenty Seventeen

Theme URI: https://wordpress.org/themes/twentyseventeen/

Author: the WordPress team

Author URI: https://wordpress.org/

Description: Twenty Seventeen brings your site to life with immersive featured images and subtle animations. With a focus on business sites, it features multiple sections on the front page as well as widgets, navigation and social menus, a logo, and more. Personalize its asymmetrical grid with a custom color scheme and showcase your multimedia content with post formats. Our default theme for 2017 works great in many languages, for any abilities, and on any device.

Version: 1.0

License: GNU General Public License v2 or later

License URI: http://www.gnu.org/licenses/gpl-2.0.html

Text Domain: twentyseventeen

Tags: one-column, two-columns, right-sidebar, flexible-header, accessibility-ready, custom-colors, custom-header, custom-menu, custom-logo, editor-style, featured-images, footer-widgets, post-formats, rtl-language-support, sticky-post, theme-options, threaded-comments, translation-ready

This theme, like WordPress, is licensed under the GPL.

Use it to make something cool, have fun, and share what you've learned with others.

*/

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

/*

Theme Name: Twenty Seventeen

Theme URI: https://wordpress.org/themes/twentyseventeen/

Author: the WordPress team

Author URI: https://wordpress.org/

Description: Twenty Seventeen brings your site to life with immersive featured images and subtle animations. With a focus on business sites, it features multiple sections on the front page as well as widgets, navigation and social menus, a logo, and more. Personalize its asymmetrical grid with a custom color scheme and showcase your multimedia content with post formats. Our default theme for 2017 works great in many languages, for any abilities, and on any device.

Version: 1.0

License: GNU General Public License v2 or later

License URI: http://www.gnu.org/licenses/gpl-2.0.html

Text Domain: twentyseventeen

Tags: one-column, two-columns, right-sidebar, flexible-header, accessibility-ready, custom-colors, custom-header, custom-menu, custom-logo, editor-style, featured-images, footer-widgets, post-formats, rtl-language-support, sticky-post, theme-options, threaded-comments, translation-ready

This theme, like WordPress, is licensed under the GPL.

Use it to make something cool, have fun, and share what you've learned with others.

*/

使用(*)表示的项目是WordPress主题库中的主题所必需的。

注意:WordPress主题存储库使用此文件中“版本”之后的数字来确定主题是否具有可用的新版本。

Theme Name (*): 主题名称。

Theme URI: 公共网页的URL,用户可以在其中找到有关该主题的更多信息。

Author (*): 开发主题的个人或组织的名称。 建议使用主题作者的wordpress.org用户名。

Author URI: 创作个人或组织的网址。

Description (*): 简短描述的主题。

Version (*): 该版本以X.X或X.X.X格式编写。

License (*): 主题的协议。

License URI (*): 主题许可证的URL。

Text Domain (*): 用于文本域的字符串用于翻译。

Tags: 允许用户使用标签过滤器查找主题的单词或短语。 标签的完整列表在“主题评论手册”中。

在所需的标题部分之后,style.css可以包含常规CSS文件中的任何内容。

style.css中的子主题

如果您的主题是“子主题”,则在style.css标题中需要“模板”行。

/*

Theme Name: My Child Theme

Template: Twenty Seventeen

*/

1

2

3

4

/*

Theme Name: My Child Theme

Template: Twenty Seventeen

*/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值