Categories

有特色的模板

CherryFramework 4. 如何添加自定义类的短代码和分配自定义CSS规则给他们

Daniel Morales August 28, 2015
Rating: 5.0/5. From 2 votes.
Please wait...

本教程将向您展示如何将自定义css类添加到短代码中,并为它们分配自定义css规则 CherryFramework 4 templates.

CherryFramework 4. 如何添加自定义类的短代码和分配自定义CSS规则给他们

Let’s create a new shortcode with custom class:

  1. 创建一个新的帖子/页面:

    CherryFramework_4_How_to_add_custom_classes_to_the_shortcodes_and_assign_custom_CSS_rules_to_them_1

  2. 选择任何想要的 shortcode. We will insert ‘Team’ shortcode as an example:

    CherryFramework_4_How_to_add_custom_classes_to_the_shortcodes_and_assign_custom_CSS_rules_to_them_2

  3. Adjust shortcode 满足您需求的参数. 向下滚动,找到 ‘Class’ box.

  4. 为此创建自定义样式类 shortcode, e.g.: ‘new_team’. Click ‘Insert shortcode button:

    CherryFramework_4_How_to_add_custom_classes_to_the_shortcodes_and_assign_custom_CSS_rules_to_them_3

  5. Custom class 已成功添加到您的 shortcode:

    CherryFramework_4_How_to_add_custom_classes_to_the_shortcodes_and_assign_custom_CSS_rules_to_them_4

我们已经成功添加了new shortcode with custom class ‘new_team’. Let’s see how to 分配自定义CSS规则 to this class:

  1. 打开帖子/页面 shortcode 您之前创建了:

    CherryFramework_4_How_to_add_custom_classes_to_the_shortcodes_and_assign_custom_CSS_rules_to_them_5

  2. We will use FireBug plugin for Firefox browser 检查元素.

  3. 检查元件 you want to edit. 找到所需的样式类:

    CherryFramework_4_How_to_add_custom_classes_to_the_shortcodes_and_assign_custom_CSS_rules_to_them_6

  4. Add your custom class 在普通的之前, add/adjust 任何需要的CSS属性:

    CherryFramework_4_How_to_add_custom_classes_to_the_shortcodes_and_assign_custom_CSS_rules_to_them_7

    现在,这些更改将应用于 custom class 只和不会影响普通样式类.

  5. Click on the CSS class 用鼠标右键选择 “复制规则声明” 选项将其复制到剪贴板:

    CherryFramework_4_How_to_add_custom_classes_to_the_shortcodes_and_assign_custom_CSS_rules_to_them_8

  6. 访问你的WordPress dashboard and navigate to Cherry > Options.

  7. 粘贴之前复制的内容 CSS rule to the User CSS box:

    CherryFramework_4_How_to_add_custom_classes_to_the_shortcodes_and_assign_custom_CSS_rules_to_them_9

  8. 导航到您的站点前端和 refresh the page 要查看变化.

本教程到此结束. 现在您知道了如何向短代码添加自定义类并为它们分配自定义CSS规则.

请随时查看下面的详细视频教程:

CherryFramework 4. 如何添加自定义类的短代码和分配自定义CSS规则给他们

Wordpress设计模板
这个条目被张贴了出来 Monstroid教程, WordPress教程 and tagged CherryFramework4, class, css, shortcode, style. Bookmark the permalink.

Submit a ticket

如果您仍然无法找到关于您的问题的足够的教程,请使用以下链接向我们的技术支持团队提交请求. 我们将在接下来的24小时内为您提供我们的帮助和协助: Submit a ticket