Accordions and toggle content material have historically required JavaScript to maintain the interplay appropriately. Trendy HTML comprises local parts that get you nearer to a non-JavaScript model of that.
Divi 5’s Semantic Parts permit customers to paintings with those local HTML parts (and plenty of others) without delay throughout the Visible Builder. You’ll assemble toggles the use of Divi’s format parts whilst outputting blank, semantic HTML that browsers perceive natively. This put up covers construct a customized toggle the use of Divi 5’s Part Kind settings, Divi design settings, and a few easy CSS to make all of it in reality easy.
Figuring out The Main points And Abstract Parts
The
detail supplies the clickable label that toggles visibility of the content material enclosed inside
. The entirety inside of
that isn’t the
stays hidden till the consumer clicks to amplify it.
Browsers render a small disclosure triangle subsequent to the abstract textual content. Clicking any place at the abstract toggles the visibility of the remainder content material. The detail is keyboard-accessible through nature, and display screen readers can announce the expanded or collapsed state by way of local semantics. That implies you generally would not have ARIA to keep up a correspondence the open or closed state, for the reason that parts do this natively.
The
detail additionally accepts an open characteristic to show the content material expanded through default. Including a shared title characteristic to a couple of
parts teams them into an unique accordion the place just one will also be open at a time. It is a more moderen enhancement, so check if you wish to have to make stronger older browsers.
Development Toggles With Divi 5’s Semantic Parts
This manner makes use of Divi 5’s Part Kind solution to assign semantic HTML tags to boxes and modules. The result’s a toggle constructed solely throughout the Visible Builder that outputs correct
and
markup. This isn’t the use of the Toggle Module in any respect — only a Workforce and a few Textual content Modules.
Environment Up The Construction
The toggle calls for 3 parts: a Workforce Module that turns into the
wrapper, a kid detail that turns into the
label, and a sibling detail that holds the collapsible content material.
Upload a Row for your web page with a single-column format. Inside of that Column, upload a Workforce Module. This Workforce will function the outer
container. The usage of a Workforce Module as a substitute of the Column itself lets you stack a couple of toggles inside the similar Column.
Cross forward and magnificence your heading if you wish to have to make it simple to learn.
Changing The Workforce To A Main points Part
Click on the Workforce Module to open its settings. Navigate to the Complex tab and find the HTML choice workforce. Click on the Part Kind dropdown and make a selection particulars from the to be had choices.
This adjustments the Workforce’s HTML output from a generic
to a
detail. The Workforce keeps all its visible styling and format features whilst gaining the local toggle conduct.
Including The Abstract Part
Throughout the Workforce, upload a Textual content Module. This module will transform the clickable toggle header. Open the Textual content Module settings and pass to the Complex tab. Within the HTML choice workforce, exchange the Part Kind to abstract. Go back to the Content material tab and input your toggle header textual content. This article turns into the clickable label that customers engage with to amplify and cave in the toggle.
At this level, the toggle seems damaged — no disclosure triangle, and clicking does not anything. As a result of we used a pre-existing module, some kinds battle with the browser-native element and abstract parts. Then again, we’ll be customizing the toggle ourselves anyway, so we’ll repair the whole thing with customized CSS. This may occasionally give us extra tactics to genre it.
Including The Collapsible Content material
Upload every other Textual content Module inside of the similar Workforce, located under the abstract Textual content Module. This module holds the content material that looks when the toggle is expanded. Depart the Part Kind at its default of
. Input the content material you wish to have to show when the toggle is opened. This may come with formatted textual content, hyperlinks, or any content material the Textual content Module helps. You’ll additionally upload further modules (pictures, buttons, and so forth.).
Including The Disclosure Chevron
Let’s upload some elementary kinds to the Workforce, together with a background colour, padding (simply at the most sensible, left, and proper, now not the ground), and a border radius.
Now onto the toggle. The toggle wishes CSS to show a visible indicator. This CSS provides a chevron from Divi’s integrated icon font that sits after the abstract textual content and flips 180 levels when the toggle opens. Upload it to the Column protecting the toggles beneath Complex > CSS > Unfastened-Shape CSS:
particulars > abstract {
list-style: none;
cursor: pointer;
}
particulars > abstract::-webkit-details-marker {
show: none;
}
particulars > abstract::after {
content material: "33";
font-family: "ETmodules";
font-size: 24px;
margin-left: 10px;
transition: grow to be 0.3s ease;
line-height: 1;
show: flex;
align-items: middle;
justify-content: middle;
}
particulars[open] > abstract::after {
grow to be: rotate(180deg);
}
.et_pb_group > :now not(abstract) {
padding-bottom: clamp(0.7rem, 0.6rem + 0.6vw, 1.1rem);
}

Let me give an explanation for each and every a part of the code and display you what each and every does thru successive movies.
First, we utterly take away the default triangle used. We will be able to use our personal icon. Marker rendering and styling range through browser, so this CSS gets rid of them the place supported and replaces them with a constant icon. Divi features a customized icon font referred to as ETmodules. As a substitute of same old characters, this font maps particular keys to icons already loaded up by way of the Theme. Environment the font-family to “ETmodules” and the content material to “33” renders a downward-pointing chevron.
Now, within the
Textual content Module, set show to Flex and set flex-direction to Row. Whilst in Format choices, set Justify Content material to Area Between. This assists in keeping the textual content and chevron aligned at the similar line, with the ::after pseudo-element putting the icon after the abstract textual content, and pushes the textual content and icon to the perimeters.
The following a part of the CSS is accountable for the animation when the toggle is clicked. We use a grow to be to rotate it 180 levels when expanded, so the chevron issues down when collapsed and up when open.
Finally, there’s CSS that selects all goods throughout the workforce (aside from for the rest wrapped within the
tag) and applies backside padding to each and every merchandise. This automates assigning the padding after each and every kid detail, so that you don’t must do it manually.
No longer essential, however if you wish to visually divide the abstract from the content material, upload a backside border to the abstract Textual content Module. Within the Design tab, pass to the Border choice workforce. In finding the Backside Border settings space and set its width to 1px. Transfer to the Spacing choice workforce and set the ground padding to clamp(0.7rem, 0.6rem + 0.6vw, 1.1rem).
And, if we needed a couple of toggles in this web page, we will merely replica the gang and regulate the content material inside.
Now, we will upload a picture beneath the second one Textual content Module, simply to turn that a couple of content material sorts and modules can be utilized throughout the toggle.
Sensible Use Circumstances For HTML Toggles
Browser-native
and
tags be offering a light-weight, available answer for organizing content material with out the efficiency value of JavaScript. Whilst maximum usually used for Steadily Requested Questions — frequently used for FAQ sections, and you’ll pair them with FAQ structured information in case you are deliberately including schema markup.
Assume you wish to have to cover dense technical specs, guaranty particulars, or “beginner-level” context in documentation in order that complex customers can scan the web page successfully.
This Part combo additionally successfully manages display screen actual property through tucking away spoilers and puzzle answers, collapsing long video transcripts or huge code blocks in technical tutorials, or even simplifying cellular interfaces through housing advanced e-commerce filters or navigation menus at the back of a blank, interactive label.
Check out Semantic Parts In Divi 5 As of late!
Divi 5‘s Semantic Parts function permits you to construct with local HTML without delay within the Visible Builder. The
and
parts ship available, JavaScript-free toggles that paintings in all trendy browsers. For those who have been searching for a lighter-weight choice to the Toggle Module, this is a superb choice for you currently.
Check out it to your subsequent FAQ segment or product web page — the setup takes mins, and the result’s cleaner markup than any plugin can be offering.
The put up How To Create Browser-Local Toggles The usage of Divi 5’s Semantic Tags seemed first on Sublime Subject matters Weblog.
WordPress Web Design
stays hidden till the consumer clicks to amplify it.
Browsers render a small disclosure triangle subsequent to the abstract textual content. Clicking any place at the abstract toggles the visibility of the remainder content material. The detail is keyboard-accessible through nature, and display screen readers can announce the expanded or collapsed state by way of local semantics. That implies you generally would not have ARIA to keep up a correspondence the open or closed state, for the reason that parts do this natively.
The
detail additionally accepts an open characteristic to show the content material expanded through default. Including a shared title characteristic to a couple of
parts teams them into an unique accordion the place just one will also be open at a time. It is a more moderen enhancement, so check if you wish to have to make stronger older browsers.
Development Toggles With Divi 5’s Semantic Parts
This manner makes use of Divi 5’s Part Kind solution to assign semantic HTML tags to boxes and modules. The result’s a toggle constructed solely throughout the Visible Builder that outputs correct
and
markup. This isn’t the use of the Toggle Module in any respect — only a Workforce and a few Textual content Modules.
Environment Up The Construction
The toggle calls for 3 parts: a Workforce Module that turns into the
wrapper, a kid detail that turns into the
label, and a sibling detail that holds the collapsible content material.
Upload a Row for your web page with a single-column format. Inside of that Column, upload a Workforce Module. This Workforce will function the outer
container. The usage of a Workforce Module as a substitute of the Column itself lets you stack a couple of toggles inside the similar Column.
Cross forward and magnificence your heading if you wish to have to make it simple to learn.
Changing The Workforce To A Main points Part
Click on the Workforce Module to open its settings. Navigate to the Complex tab and find the HTML choice workforce. Click on the Part Kind dropdown and make a selection particulars from the to be had choices.
This adjustments the Workforce’s HTML output from a generic
to a
detail. The Workforce keeps all its visible styling and format features whilst gaining the local toggle conduct.
Including The Abstract Part
Throughout the Workforce, upload a Textual content Module. This module will transform the clickable toggle header. Open the Textual content Module settings and pass to the Complex tab. Within the HTML choice workforce, exchange the Part Kind to abstract. Go back to the Content material tab and input your toggle header textual content. This article turns into the clickable label that customers engage with to amplify and cave in the toggle.
At this level, the toggle seems damaged — no disclosure triangle, and clicking does not anything. As a result of we used a pre-existing module, some kinds battle with the browser-native element and abstract parts. Then again, we’ll be customizing the toggle ourselves anyway, so we’ll repair the whole thing with customized CSS. This may occasionally give us extra tactics to genre it.
Including The Collapsible Content material
Upload every other Textual content Module inside of the similar Workforce, located under the abstract Textual content Module. This module holds the content material that looks when the toggle is expanded. Depart the Part Kind at its default of
. Input the content material you wish to have to show when the toggle is opened. This may come with formatted textual content, hyperlinks, or any content material the Textual content Module helps. You’ll additionally upload further modules (pictures, buttons, and so forth.).
Including The Disclosure Chevron
Let’s upload some elementary kinds to the Workforce, together with a background colour, padding (simply at the most sensible, left, and proper, now not the ground), and a border radius.
Now onto the toggle. The toggle wishes CSS to show a visible indicator. This CSS provides a chevron from Divi’s integrated icon font that sits after the abstract textual content and flips 180 levels when the toggle opens. Upload it to the Column protecting the toggles beneath Complex > CSS > Unfastened-Shape CSS:
particulars > abstract {
list-style: none;
cursor: pointer;
}
particulars > abstract::-webkit-details-marker {
show: none;
}
particulars > abstract::after {
content material: "33";
font-family: "ETmodules";
font-size: 24px;
margin-left: 10px;
transition: grow to be 0.3s ease;
line-height: 1;
show: flex;
align-items: middle;
justify-content: middle;
}
particulars[open] > abstract::after {
grow to be: rotate(180deg);
}
.et_pb_group > :now not(abstract) {
padding-bottom: clamp(0.7rem, 0.6rem + 0.6vw, 1.1rem);
}

Let me give an explanation for each and every a part of the code and display you what each and every does thru successive movies.
First, we utterly take away the default triangle used. We will be able to use our personal icon. Marker rendering and styling range through browser, so this CSS gets rid of them the place supported and replaces them with a constant icon. Divi features a customized icon font referred to as ETmodules. As a substitute of same old characters, this font maps particular keys to icons already loaded up by way of the Theme. Environment the font-family to “ETmodules” and the content material to “33” renders a downward-pointing chevron.
Now, within the
Textual content Module, set show to Flex and set flex-direction to Row. Whilst in Format choices, set Justify Content material to Area Between. This assists in keeping the textual content and chevron aligned at the similar line, with the ::after pseudo-element putting the icon after the abstract textual content, and pushes the textual content and icon to the perimeters.
The following a part of the CSS is accountable for the animation when the toggle is clicked. We use a grow to be to rotate it 180 levels when expanded, so the chevron issues down when collapsed and up when open.
Finally, there’s CSS that selects all goods throughout the workforce (aside from for the rest wrapped within the
tag) and applies backside padding to each and every merchandise. This automates assigning the padding after each and every kid detail, so that you don’t must do it manually.
No longer essential, however if you wish to visually divide the abstract from the content material, upload a backside border to the abstract Textual content Module. Within the Design tab, pass to the Border choice workforce. In finding the Backside Border settings space and set its width to 1px. Transfer to the Spacing choice workforce and set the ground padding to clamp(0.7rem, 0.6rem + 0.6vw, 1.1rem).
And, if we needed a couple of toggles in this web page, we will merely replica the gang and regulate the content material inside.
Now, we will upload a picture beneath the second one Textual content Module, simply to turn that a couple of content material sorts and modules can be utilized throughout the toggle.
Sensible Use Circumstances For HTML Toggles
Browser-native
and
tags be offering a light-weight, available answer for organizing content material with out the efficiency value of JavaScript. Whilst maximum usually used for Steadily Requested Questions — frequently used for FAQ sections, and you’ll pair them with FAQ structured information in case you are deliberately including schema markup.
Assume you wish to have to cover dense technical specs, guaranty particulars, or “beginner-level” context in documentation in order that complex customers can scan the web page successfully.
This Part combo additionally successfully manages display screen actual property through tucking away spoilers and puzzle answers, collapsing long video transcripts or huge code blocks in technical tutorials, or even simplifying cellular interfaces through housing advanced e-commerce filters or navigation menus at the back of a blank, interactive label.
Check out Semantic Parts In Divi 5 As of late!
Divi 5‘s Semantic Parts function permits you to construct with local HTML without delay within the Visible Builder. The
and
parts ship available, JavaScript-free toggles that paintings in all trendy browsers. For those who have been searching for a lighter-weight choice to the Toggle Module, this is a superb choice for you currently.
Check out it to your subsequent FAQ segment or product web page — the setup takes mins, and the result’s cleaner markup than any plugin can be offering.
The put up How To Create Browser-Local Toggles The usage of Divi 5’s Semantic Tags seemed first on Sublime Subject matters Weblog.
WordPress Web Design
Development Toggles With Divi 5’s Semantic Parts
This manner makes use of Divi 5’s Part Kind solution to assign semantic HTML tags to boxes and modules. The result’s a toggle constructed solely throughout the Visible Builder that outputs correct
markup. This isn’t the use of the Toggle Module in any respect — only a Workforce and a few Textual content Modules.
Environment Up The Construction
The toggle calls for 3 parts: a Workforce Module that turns into the
wrapper, a kid detail that turns into the
label, and a sibling detail that holds the collapsible content material.
Upload a Row for your web page with a single-column format. Inside of that Column, upload a Workforce Module. This Workforce will function the outer
container. The usage of a Workforce Module as a substitute of the Column itself lets you stack a couple of toggles inside the similar Column.
Cross forward and magnificence your heading if you wish to have to make it simple to learn.
Changing The Workforce To A Main points Part
Click on the Workforce Module to open its settings. Navigate to the Complex tab and find the HTML choice workforce. Click on the Part Kind dropdown and make a selection particulars from the to be had choices.
This adjustments the Workforce’s HTML output from a generic
to a
detail. The Workforce keeps all its visible styling and format features whilst gaining the local toggle conduct.
Including The Abstract Part
Throughout the Workforce, upload a Textual content Module. This module will transform the clickable toggle header. Open the Textual content Module settings and pass to the Complex tab. Within the HTML choice workforce, exchange the Part Kind to abstract. Go back to the Content material tab and input your toggle header textual content. This article turns into the clickable label that customers engage with to amplify and cave in the toggle.
At this level, the toggle seems damaged — no disclosure triangle, and clicking does not anything. As a result of we used a pre-existing module, some kinds battle with the browser-native element and abstract parts. Then again, we’ll be customizing the toggle ourselves anyway, so we’ll repair the whole thing with customized CSS. This may occasionally give us extra tactics to genre it.
Including The Collapsible Content material
Upload every other Textual content Module inside of the similar Workforce, located under the abstract Textual content Module. This module holds the content material that looks when the toggle is expanded. Depart the Part Kind at its default of
. Input the content material you wish to have to show when the toggle is opened. This may come with formatted textual content, hyperlinks, or any content material the Textual content Module helps. You’ll additionally upload further modules (pictures, buttons, and so forth.).
Including The Disclosure Chevron
Let’s upload some elementary kinds to the Workforce, together with a background colour, padding (simply at the most sensible, left, and proper, now not the ground), and a border radius.
Now onto the toggle. The toggle wishes CSS to show a visible indicator. This CSS provides a chevron from Divi’s integrated icon font that sits after the abstract textual content and flips 180 levels when the toggle opens. Upload it to the Column protecting the toggles beneath Complex > CSS > Unfastened-Shape CSS:
particulars > abstract {
list-style: none;
cursor: pointer;
}
particulars > abstract::-webkit-details-marker {
show: none;
}
particulars > abstract::after {
content material: "33";
font-family: "ETmodules";
font-size: 24px;
margin-left: 10px;
transition: grow to be 0.3s ease;
line-height: 1;
show: flex;
align-items: middle;
justify-content: middle;
}
particulars[open] > abstract::after {
grow to be: rotate(180deg);
}
.et_pb_group > :now not(abstract) {
padding-bottom: clamp(0.7rem, 0.6rem + 0.6vw, 1.1rem);
}

Let me give an explanation for each and every a part of the code and display you what each and every does thru successive movies.
First, we utterly take away the default triangle used. We will be able to use our personal icon. Marker rendering and styling range through browser, so this CSS gets rid of them the place supported and replaces them with a constant icon. Divi features a customized icon font referred to as ETmodules. As a substitute of same old characters, this font maps particular keys to icons already loaded up by way of the Theme. Environment the font-family to “ETmodules” and the content material to “33” renders a downward-pointing chevron.
Now, within the
Textual content Module, set show to Flex and set flex-direction to Row. Whilst in Format choices, set Justify Content material to Area Between. This assists in keeping the textual content and chevron aligned at the similar line, with the ::after pseudo-element putting the icon after the abstract textual content, and pushes the textual content and icon to the perimeters.
The following a part of the CSS is accountable for the animation when the toggle is clicked. We use a grow to be to rotate it 180 levels when expanded, so the chevron issues down when collapsed and up when open.
Finally, there’s CSS that selects all goods throughout the workforce (aside from for the rest wrapped within the
tag) and applies backside padding to each and every merchandise. This automates assigning the padding after each and every kid detail, so that you don’t must do it manually.
No longer essential, however if you wish to visually divide the abstract from the content material, upload a backside border to the abstract Textual content Module. Within the Design tab, pass to the Border choice workforce. In finding the Backside Border settings space and set its width to 1px. Transfer to the Spacing choice workforce and set the ground padding to clamp(0.7rem, 0.6rem + 0.6vw, 1.1rem).
And, if we needed a couple of toggles in this web page, we will merely replica the gang and regulate the content material inside.
Now, we will upload a picture beneath the second one Textual content Module, simply to turn that a couple of content material sorts and modules can be utilized throughout the toggle.
Sensible Use Circumstances For HTML Toggles
Browser-native
and
tags be offering a light-weight, available answer for organizing content material with out the efficiency value of JavaScript. Whilst maximum usually used for Steadily Requested Questions — frequently used for FAQ sections, and you’ll pair them with FAQ structured information in case you are deliberately including schema markup.
Assume you wish to have to cover dense technical specs, guaranty particulars, or “beginner-level” context in documentation in order that complex customers can scan the web page successfully.
This Part combo additionally successfully manages display screen actual property through tucking away spoilers and puzzle answers, collapsing long video transcripts or huge code blocks in technical tutorials, or even simplifying cellular interfaces through housing advanced e-commerce filters or navigation menus at the back of a blank, interactive label.
Check out Semantic Parts In Divi 5 As of late!
Divi 5‘s Semantic Parts function permits you to construct with local HTML without delay within the Visible Builder. The
and
parts ship available, JavaScript-free toggles that paintings in all trendy browsers. For those who have been searching for a lighter-weight choice to the Toggle Module, this is a superb choice for you currently.
Check out it to your subsequent FAQ segment or product web page — the setup takes mins, and the result’s cleaner markup than any plugin can be offering.
The put up How To Create Browser-Local Toggles The usage of Divi 5’s Semantic Tags seemed first on Sublime Subject matters Weblog.
WordPress Web Design
label, and a sibling detail that holds the collapsible content material.
Upload a Row for your web page with a single-column format. Inside of that Column, upload a Workforce Module. This Workforce will function the outer
container. The usage of a Workforce Module as a substitute of the Column itself lets you stack a couple of toggles inside the similar Column.
Cross forward and magnificence your heading if you wish to have to make it simple to learn.
Changing The Workforce To A Main points Part
Click on the Workforce Module to open its settings. Navigate to the Complex tab and find the HTML choice workforce. Click on the Part Kind dropdown and make a selection particulars from the to be had choices.
This adjustments the Workforce’s HTML output from a generic
to a
detail. The Workforce keeps all its visible styling and format features whilst gaining the local toggle conduct.
Including The Abstract Part
Throughout the Workforce, upload a Textual content Module. This module will transform the clickable toggle header. Open the Textual content Module settings and pass to the Complex tab. Within the HTML choice workforce, exchange the Part Kind to abstract. Go back to the Content material tab and input your toggle header textual content. This article turns into the clickable label that customers engage with to amplify and cave in the toggle.
At this level, the toggle seems damaged — no disclosure triangle, and clicking does not anything. As a result of we used a pre-existing module, some kinds battle with the browser-native element and abstract parts. Then again, we’ll be customizing the toggle ourselves anyway, so we’ll repair the whole thing with customized CSS. This may occasionally give us extra tactics to genre it.
Including The Collapsible Content material
Upload every other Textual content Module inside of the similar Workforce, located under the abstract Textual content Module. This module holds the content material that looks when the toggle is expanded. Depart the Part Kind at its default of
. Input the content material you wish to have to show when the toggle is opened. This may come with formatted textual content, hyperlinks, or any content material the Textual content Module helps. You’ll additionally upload further modules (pictures, buttons, and so forth.).
Including The Disclosure Chevron
Let’s upload some elementary kinds to the Workforce, together with a background colour, padding (simply at the most sensible, left, and proper, now not the ground), and a border radius.
Now onto the toggle. The toggle wishes CSS to show a visible indicator. This CSS provides a chevron from Divi’s integrated icon font that sits after the abstract textual content and flips 180 levels when the toggle opens. Upload it to the Column protecting the toggles beneath Complex > CSS > Unfastened-Shape CSS:
particulars > abstract {
list-style: none;
cursor: pointer;
}
particulars > abstract::-webkit-details-marker {
show: none;
}
particulars > abstract::after {
content material: "33";
font-family: "ETmodules";
font-size: 24px;
margin-left: 10px;
transition: grow to be 0.3s ease;
line-height: 1;
show: flex;
align-items: middle;
justify-content: middle;
}
particulars[open] > abstract::after {
grow to be: rotate(180deg);
}
.et_pb_group > :now not(abstract) {
padding-bottom: clamp(0.7rem, 0.6rem + 0.6vw, 1.1rem);
}

Let me give an explanation for each and every a part of the code and display you what each and every does thru successive movies.
First, we utterly take away the default triangle used. We will be able to use our personal icon. Marker rendering and styling range through browser, so this CSS gets rid of them the place supported and replaces them with a constant icon. Divi features a customized icon font referred to as ETmodules. As a substitute of same old characters, this font maps particular keys to icons already loaded up by way of the Theme. Environment the font-family to “ETmodules” and the content material to “33” renders a downward-pointing chevron.
Now, within the
Textual content Module, set show to Flex and set flex-direction to Row. Whilst in Format choices, set Justify Content material to Area Between. This assists in keeping the textual content and chevron aligned at the similar line, with the ::after pseudo-element putting the icon after the abstract textual content, and pushes the textual content and icon to the perimeters.
The following a part of the CSS is accountable for the animation when the toggle is clicked. We use a grow to be to rotate it 180 levels when expanded, so the chevron issues down when collapsed and up when open.
Finally, there’s CSS that selects all goods throughout the workforce (aside from for the rest wrapped within the
tag) and applies backside padding to each and every merchandise. This automates assigning the padding after each and every kid detail, so that you don’t must do it manually.
No longer essential, however if you wish to visually divide the abstract from the content material, upload a backside border to the abstract Textual content Module. Within the Design tab, pass to the Border choice workforce. In finding the Backside Border settings space and set its width to 1px. Transfer to the Spacing choice workforce and set the ground padding to clamp(0.7rem, 0.6rem + 0.6vw, 1.1rem).
And, if we needed a couple of toggles in this web page, we will merely replica the gang and regulate the content material inside.
Now, we will upload a picture beneath the second one Textual content Module, simply to turn that a couple of content material sorts and modules can be utilized throughout the toggle.
Sensible Use Circumstances For HTML Toggles
Browser-native
and
tags be offering a light-weight, available answer for organizing content material with out the efficiency value of JavaScript. Whilst maximum usually used for Steadily Requested Questions — frequently used for FAQ sections, and you’ll pair them with FAQ structured information in case you are deliberately including schema markup.
Assume you wish to have to cover dense technical specs, guaranty particulars, or “beginner-level” context in documentation in order that complex customers can scan the web page successfully.
This Part combo additionally successfully manages display screen actual property through tucking away spoilers and puzzle answers, collapsing long video transcripts or huge code blocks in technical tutorials, or even simplifying cellular interfaces through housing advanced e-commerce filters or navigation menus at the back of a blank, interactive label.
Check out Semantic Parts In Divi 5 As of late!
Divi 5‘s Semantic Parts function permits you to construct with local HTML without delay within the Visible Builder. The
and
parts ship available, JavaScript-free toggles that paintings in all trendy browsers. For those who have been searching for a lighter-weight choice to the Toggle Module, this is a superb choice for you currently.
Check out it to your subsequent FAQ segment or product web page — the setup takes mins, and the result’s cleaner markup than any plugin can be offering.
The put up How To Create Browser-Local Toggles The usage of Divi 5’s Semantic Tags seemed first on Sublime Subject matters Weblog.
WordPress Web Design
Cross forward and magnificence your heading if you wish to have to make it simple to learn.
Changing The Workforce To A Main points Part
Click on the Workforce Module to open its settings. Navigate to the Complex tab and find the HTML choice workforce. Click on the Part Kind dropdown and make a selection particulars from the to be had choices.
This adjustments the Workforce’s HTML output from a generic
Including The Abstract Part
Throughout the Workforce, upload a Textual content Module. This module will transform the clickable toggle header. Open the Textual content Module settings and pass to the Complex tab. Within the HTML choice workforce, exchange the Part Kind to abstract. Go back to the Content material tab and input your toggle header textual content. This article turns into the clickable label that customers engage with to amplify and cave in the toggle.
At this level, the toggle seems damaged — no disclosure triangle, and clicking does not anything. As a result of we used a pre-existing module, some kinds battle with the browser-native element and abstract parts. Then again, we’ll be customizing the toggle ourselves anyway, so we’ll repair the whole thing with customized CSS. This may occasionally give us extra tactics to genre it.
Including The Collapsible Content material
Upload every other Textual content Module inside of the similar Workforce, located under the abstract Textual content Module. This module holds the content material that looks when the toggle is expanded. Depart the Part Kind at its default of
Including The Disclosure Chevron
Let’s upload some elementary kinds to the Workforce, together with a background colour, padding (simply at the most sensible, left, and proper, now not the ground), and a border radius.
Now onto the toggle. The toggle wishes CSS to show a visible indicator. This CSS provides a chevron from Divi’s integrated icon font that sits after the abstract textual content and flips 180 levels when the toggle opens. Upload it to the Column protecting the toggles beneath Complex > CSS > Unfastened-Shape CSS:
particulars > abstract {
list-style: none;
cursor: pointer;
}
particulars > abstract::-webkit-details-marker {
show: none;
}
particulars > abstract::after {
content material: "33";
font-family: "ETmodules";
font-size: 24px;
margin-left: 10px;
transition: grow to be 0.3s ease;
line-height: 1;
show: flex;
align-items: middle;
justify-content: middle;
}
particulars[open] > abstract::after {
grow to be: rotate(180deg);
}
.et_pb_group > :now not(abstract) {
padding-bottom: clamp(0.7rem, 0.6rem + 0.6vw, 1.1rem);
}

Let me give an explanation for each and every a part of the code and display you what each and every does thru successive movies.
First, we utterly take away the default triangle used. We will be able to use our personal icon. Marker rendering and styling range through browser, so this CSS gets rid of them the place supported and replaces them with a constant icon. Divi features a customized icon font referred to as ETmodules. As a substitute of same old characters, this font maps particular keys to icons already loaded up by way of the Theme. Environment the font-family to “ETmodules” and the content material to “33” renders a downward-pointing chevron.
Now, within the
Textual content Module, set show to Flex and set flex-direction to Row. Whilst in Format choices, set Justify Content material to Area Between. This assists in keeping the textual content and chevron aligned at the similar line, with the ::after pseudo-element putting the icon after the abstract textual content, and pushes the textual content and icon to the perimeters.
The following a part of the CSS is accountable for the animation when the toggle is clicked. We use a grow to be to rotate it 180 levels when expanded, so the chevron issues down when collapsed and up when open.
Finally, there’s CSS that selects all goods throughout the workforce (aside from for the rest wrapped within the
tag) and applies backside padding to each and every merchandise. This automates assigning the padding after each and every kid detail, so that you don’t must do it manually.
No longer essential, however if you wish to visually divide the abstract from the content material, upload a backside border to the abstract Textual content Module. Within the Design tab, pass to the Border choice workforce. In finding the Backside Border settings space and set its width to 1px. Transfer to the Spacing choice workforce and set the ground padding to clamp(0.7rem, 0.6rem + 0.6vw, 1.1rem).
And, if we needed a couple of toggles in this web page, we will merely replica the gang and regulate the content material inside.
Now, we will upload a picture beneath the second one Textual content Module, simply to turn that a couple of content material sorts and modules can be utilized throughout the toggle.
Sensible Use Circumstances For HTML Toggles
Browser-native
and
tags be offering a light-weight, available answer for organizing content material with out the efficiency value of JavaScript. Whilst maximum usually used for Steadily Requested Questions — frequently used for FAQ sections, and you’ll pair them with FAQ structured information in case you are deliberately including schema markup.
Assume you wish to have to cover dense technical specs, guaranty particulars, or “beginner-level” context in documentation in order that complex customers can scan the web page successfully.
This Part combo additionally successfully manages display screen actual property through tucking away spoilers and puzzle answers, collapsing long video transcripts or huge code blocks in technical tutorials, or even simplifying cellular interfaces through housing advanced e-commerce filters or navigation menus at the back of a blank, interactive label.
Check out Semantic Parts In Divi 5 As of late!
Divi 5‘s Semantic Parts function permits you to construct with local HTML without delay within the Visible Builder. The
and
parts ship available, JavaScript-free toggles that paintings in all trendy browsers. For those who have been searching for a lighter-weight choice to the Toggle Module, this is a superb choice for you currently.
Check out it to your subsequent FAQ segment or product web page — the setup takes mins, and the result’s cleaner markup than any plugin can be offering.
The put up How To Create Browser-Local Toggles The usage of Divi 5’s Semantic Tags seemed first on Sublime Subject matters Weblog.
WordPress Web Design
No longer essential, however if you wish to visually divide the abstract from the content material, upload a backside border to the abstract Textual content Module. Within the Design tab, pass to the Border choice workforce. In finding the Backside Border settings space and set its width to 1px. Transfer to the Spacing choice workforce and set the ground padding to clamp(0.7rem, 0.6rem + 0.6vw, 1.1rem).
And, if we needed a couple of toggles in this web page, we will merely replica the gang and regulate the content material inside.
Now, we will upload a picture beneath the second one Textual content Module, simply to turn that a couple of content material sorts and modules can be utilized throughout the toggle.
Sensible Use Circumstances For HTML Toggles
Browser-native
