×
1 Choose EITC/EITCA Certificates
2 Learn and take online exams
3 Get your IT skills certified

Confirm your IT skills and competencies under the European IT Certification framework from anywhere in the world fully online.

EITCA Academy

Digital skills attestation standard by the European IT Certification Institute aiming to support Digital Society development

SIGN IN YOUR ACCOUNT TO HAVE ACCESS TO DIFFERENT FEATURES

CREATE AN ACCOUNT FORGOT YOUR PASSWORD?

FORGOT YOUR DETAILS?

AAH, WAIT, I REMEMBER NOW!

CREATE ACCOUNT

ALREADY HAVE AN ACCOUNT?
EUROPEAN INFORMATION TECHNOLOGIES CERTIFICATION ACADEMY - ATTESTING YOUR PROFESSIONAL DIGITAL SKILLS
  • SIGN UP
  • LOGIN
  • SUPPORT

EITCA Academy

EITCA Academy

The European Information Technologies Certification Institute - EITCI ASBL

Certification Provider

EITCI Institute ASBL

Brussels, European Union

Governing European IT Certification (EITC) framework in support of the IT professionalism and Digital Society

  • CERTIFICATES
    • EITCA ACADEMIES
      • EITCA ACADEMIES CATALOGUE<
      • EITCA/CG COMPUTER GRAPHICS
      • EITCA/IS INFORMATION SECURITY
      • EITCA/BI BUSINESS INFORMATION
      • EITCA/KC KEY COMPETENCIES
      • EITCA/EG E-GOVERNMENT
      • EITCA/WD WEB DEVELOPMENT
      • EITCA/AI ARTIFICIAL INTELLIGENCE
    • EITC CERTIFICATES
      • EITC CERTIFICATES CATALOGUE<
      • COMPUTER GRAPHICS CERTIFICATES
      • WEB DESIGN CERTIFICATES
      • 3D DESIGN CERTIFICATES
      • OFFICE IT CERTIFICATES
      • BITCOIN BLOCKCHAIN CERTIFICATE
      • WORDPRESS CERTIFICATE
      • CLOUD PLATFORM CERTIFICATENEW
    • EITC CERTIFICATES
      • INTERNET CERTIFICATES
      • CRYPTOGRAPHY CERTIFICATES
      • BUSINESS IT CERTIFICATES
      • TELEWORK CERTIFICATES
      • PROGRAMMING CERTIFICATES
      • DIGITAL PORTRAIT CERTIFICATE
      • WEB DEVELOPMENT CERTIFICATES
      • DEEP LEARNING CERTIFICATESNEW
    • CERTIFICATES FOR
      • EU PUBLIC ADMINISTRATION
      • TEACHERS AND EDUCATORS
      • IT SECURITY PROFESSIONALS
      • GRAPHICS DESIGNERS & ARTISTS
      • BUSINESSMEN AND MANAGERS
      • BLOCKCHAIN DEVELOPERS
      • WEB DEVELOPERS
      • CLOUD AI EXPERTSNEW
  • FEATURED
  • SUBSIDY
  • HOW IT WORKS
  •   IT ID
  • ABOUT
  • CONTACT
  • MY ORDER
    Your current order is empty.
EITCIINSTITUTE
CERTIFIED

What features are available in the Advanced tab for a selected block in the Gutenberg editor, and how can users add custom CSS classes for further styling?

by EITCA Academy / Wednesday, 12 June 2024 / Published in Web Development, EITC/WD/WPF WordPress Fundamentals, Content management, WordPress Gutenberg Editor, Examination review

The Gutenberg editor, a significant component of the WordPress ecosystem, has revolutionized the way content is created and managed. The Advanced tab for a selected block within the Gutenberg editor offers several features that enhance the flexibility and customization of the content blocks. This detailed exploration will cover the available features in the Advanced tab and demonstrate how users can add custom CSS classes for further styling.

Features in the Advanced Tab

The Advanced tab in the Gutenberg editor provides a set of features designed to give users more control over the individual blocks. These features include:

1. HTML Anchor

The HTML Anchor feature allows users to create a unique identifier for a block. This identifier can be used to link directly to the block from other parts of the content or even from external pages. By setting an HTML anchor, users can facilitate smooth navigation within long-form content, making it easier for readers to jump to specific sections.

Example:
If you have a heading block with the anchor set to `#about-us`, you can link to this section from anywhere on your site using the URL `http://yoursite.com/page#about-us`.

2. Additional CSS Class(es)

This feature is particularly powerful for users who want to apply custom styles to a block. By entering one or more CSS class names into this field, users can target the block with custom CSS rules defined in the theme’s stylesheet or a custom CSS plugin.

Example:
If you add a class `custom-highlight` to a paragraph block, you can define the following CSS in your stylesheet to style this block:

css
.custom-highlight {
    background-color: yellow;
    font-weight: bold;
}
3. Custom Attributes

Some blocks support additional custom attributes that can be defined in the Advanced tab. These attributes allow developers to add custom data properties or ARIA attributes to enhance accessibility and functionality.

Example:
Adding a `data-toggle="modal"` attribute to a button block can be used to trigger a modal popup using JavaScript.

Adding Custom CSS Classes for Further Styling

To add custom CSS classes for further styling, follow these steps:

1. Select the Block:
First, click on the block you wish to style. This could be any block, such as a paragraph, heading, image, or custom block.

2. Open the Advanced Tab:
In the block settings sidebar on the right, scroll down to find the “Advanced” tab. Click on it to expand the options available.

3. Enter the CSS Class:
In the “Additional CSS Class(es)” field, enter the class name(s) you wish to assign to the block. Ensure that class names are separated by spaces if you are adding multiple classes.

4. Define the CSS:
Next, you need to define the CSS rules in your theme’s stylesheet or a custom CSS section provided by your theme or a plugin. Navigate to the Appearance > Customize > Additional CSS section in your WordPress dashboard to add your custom styles.

Example:
Suppose you want to create a custom style for a call-to-action button. You could add the class `cta-button` in the Additional CSS Class(es) field for the button block and then define the following CSS:

css
.cta-button {
    background-color: #ff5722;
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 5px;
    text-align: center;
    display: inline-block;
    text-decoration: none;
}
.cta-button:hover {
    background-color: #e64a19;
}

Practical Use Cases and Examples

Case 1: Highlighting Important Text

A common use case for custom CSS classes is to highlight important text within a post or page. For instance, you may want to draw attention to a key point or a quote.

1. Add a Custom Class:
Select the paragraph block containing the important text and add the class `highlight-text` in the Additional CSS Class(es) field.

2. Define the CSS:
Add the following CSS to your stylesheet:

css
   .highlight-text {
       background-color: #ffff99;
       padding: 5px;
       border-left: 3px solid #ffcc00;
   }
   

This will highlight the text with a yellow background and a border, making it stand out from the rest of the content.

Case 2: Styling a Testimonials Section

Another practical example is styling a testimonials section. Suppose you have multiple testimonial blocks and you want to apply a consistent style to all of them.

1. Add a Custom Class:
For each testimonial block, add the class `testimonial-block` in the Additional CSS Class(es) field.

2. Define the CSS:
Add the following CSS to your stylesheet:

css
   .testimonial-block {
       border: 1px solid #ddd;
       padding: 15px;
       margin: 10px 0;
       background-color: #f9f9f9;
       border-radius: 5px;
   }
   .testimonial-block .testimonial-author {
       font-weight: bold;
       margin-top: 10px;
   }
   

This CSS will apply a border, padding, and background color to each testimonial block, creating a uniform and visually appealing section on your page.

Advanced Customization with JavaScript

In addition to CSS, you can use JavaScript to enhance the functionality of blocks with custom classes. For example, you might want to add interactivity or dynamic behavior to certain elements.

Example:
Suppose you want to create a collapsible section that expands when clicked. You can achieve this with a combination of CSS and JavaScript.

1. Add a Custom Class:
Add the class `collapsible-section` to the block you want to make collapsible.

2. Define the CSS:
Add the following CSS to hide the content by default:

css
   .collapsible-section {
       cursor: pointer;
   }
   .collapsible-section .content {
       display: none;
       padding: 10px;
       border: 1px solid #ddd;
       margin-top: 5px;
   }
   .collapsible-section.active .content {
       display: block;
   }
   

3. Add JavaScript:
Add the following JavaScript to toggle the visibility of the content when the section is clicked:

javascript
   document.addEventListener('DOMContentLoaded', function() {
       var collapsibleSections = document.querySelectorAll('.collapsible-section');
       collapsibleSections.forEach(function(section) {
           section.addEventListener('click', function() {
               section.classList.toggle('active');
           });
       });
   });
   

This script listens for click events on elements with the `collapsible-section` class and toggles the `active` class, which in turn controls the visibility of the content.

Accessibility Considerations

When adding custom CSS classes and attributes, it is important to consider accessibility. Ensure that any customizations do not hinder the usability of the site for users with disabilities. Use ARIA attributes and roles where necessary to improve the accessibility of interactive elements.

Example:
For the collapsible section example, you can enhance accessibility by adding ARIA attributes:
1. Update the HTML:
Add ARIA attributes to the collapsible section:

html
   <div class="collapsible-section" role="button" aria-expanded="false">
       <div class="content" aria-hidden="true">
           <!-- Content goes here -->
       </div>
   </div>
   

2. Update JavaScript:
Modify the JavaScript to update ARIA attributes when the section is toggled:

javascript
   document.addEventListener('DOMContentLoaded', function() {
       var collapsibleSections = document.querySelectorAll('.collapsible-section');
       collapsibleSections.forEach(function(section) {
           section.addEventListener('click', function() {
               var isActive = section.classList.toggle('active');
               section.setAttribute('aria-expanded', isActive);
               section.querySelector('.content').setAttribute('aria-hidden', !isActive);
           });
       });
   });
   

These enhancements ensure that screen readers and other assistive technologies can correctly interpret the state of the collapsible sections.

Conclusion

The Advanced tab in the Gutenberg editor provides essential features that empower users to customize and enhance their content blocks effectively. By leveraging the HTML Anchor, Additional CSS Class(es), and Custom Attributes, users can create a more dynamic and visually appealing website. Adding custom CSS classes allows for precise styling, while JavaScript can introduce interactivity and dynamic behavior. Always consider accessibility when implementing customizations to ensure an inclusive user experience.

Other recent questions and answers regarding Content management:

  • Can a post be changed into a page in WordPress?
  • What are the procedures to edit or delete an existing menu in WordPress?
  • How can you assign a menu to different locations defined by your WordPress theme?
  • What methods can be used to rearrange the order of menu items in WordPress?
  • How can you add different types of items, such as pages, posts, custom links, and categories, to a menu in WordPress?
  • What steps are involved in creating a new menu in WordPress?
  • What are some common types of widgets available in WordPress, and what specific features or content can they add to a website?
  • How do the number and location of sidebars vary between different WordPress themes, and what impact does this have on site customization?
  • What are the steps to temporarily remove a widget from a sidebar without losing its settings, and where can you find the removed widget?
  • How can you add a new widget to a sidebar in WordPress, and what steps are involved in customizing it?

View more questions and answers in Content management

More questions and answers:

  • Field: Web Development
  • Programme: EITC/WD/WPF WordPress Fundamentals (go to the certification programme)
  • Lesson: Content management (go to related lesson)
  • Topic: WordPress Gutenberg Editor (go to related topic)
  • Examination review
Tagged under: Accessibility, CSS, HTML, JavaScript, Web Development, WordPress
Home » Content management / EITC/WD/WPF WordPress Fundamentals / Examination review / Web Development / WordPress Gutenberg Editor » What features are available in the Advanced tab for a selected block in the Gutenberg editor, and how can users add custom CSS classes for further styling?

Certification Center

USER MENU

  • My Account

CERTIFICATE CATEGORY

  • EITC Certification (106)
  • EITCA Certification (9)

What are you looking for?

  • Introduction
  • How it works?
  • EITCA Academies
  • EITCI DSJC Subsidy
  • Full EITC catalogue
  • Your order
  • Featured
  •   IT ID
  • EITCA reviews (Reddit publ.)
  • About
  • Contact
  • Cookie Policy (EU)

EITCA Academy is a part of the European IT Certification framework

The European IT Certification framework has been established in 2008 as a Europe based and vendor independent standard in widely accessible online certification of digital skills and competencies in many areas of professional digital specializations. The EITC framework is governed by the European IT Certification Institute (EITCI), a non-profit certification authority supporting information society growth and bridging the digital skills gap in the EU.

    EITCA Academy Secretary Office

    European IT Certification Institute ASBL
    Brussels, Belgium, European Union

    EITC / EITCA Certification Framework Operator
    Governing European IT Certification Standard
    Access contact form or call +32 25887351

    Follow EITCI on Twitter
    Visit EITCA Academy on Facebook
    Engage with EITCA Academy on LinkedIn
    Check out EITCI and EITCA videos on YouTube

    Funded by the European Union

    Funded by the European Regional Development Fund (ERDF) and the European Social Fund (ESF), governed by the EITCI Institute since 2008

    Information Security Policy | DSRRM and GDPR Policy | Data Protection Policy | Record of Processing Activities | HSE Policy | Anti-Corruption Policy | Modern Slavery Policy

    Automatically translate to your language

    Terms and Conditions | Privacy Policy
    Follow @EITCI
    EITCA Academy

    Your browser doesn't support the HTML5 CANVAS tag.

    • Quantum Information
    • Web Development
    • Artificial Intelligence
    • Cloud Computing
    • Cybersecurity
    • GET SOCIAL
    EITCA Academy


    © 2008-2026  European IT Certification Institute
    Brussels, Belgium, European Union

    TOP
    CHAT WITH SUPPORT
    Do you have any questions?
    We will reply here and by email. Your conversation is tracked with a support token.