Separating line under headings


I would like to style some headings, not all of them, to display the same colored line under the slider title.

What I mean is to be able to call the same class in a “h1” tag in different sections of the site, something like
<h1 class="maintitle"> so that the lines is automatically displayed.

I prefer the wider line of the slider instead of the small lines of the widgets.

Is that possible?




Please try this Custom CSS and let me know how it works:

h1.maintitle:after {
    border-bottom: 2px solid red;
    width: 100px !important;
    margin: 0 auto !important;

Please make sure to set the class of the h1 tag to “maintitle”, you’ve added “maintitle:after” as class which is incorrect. Also, please try to use Elementor divider, that’s why we have added the border on the bottom of the titles.

Please add the above CSS to your Child Theme’s style.css or in case you haven’t setup a Child Theme already, then you can also add the CSS to wp-admin -> Appearance -> Customizer -> Additional CSS so you won’t loose the changes after Theme or WordPress updates.

Please let me know how it works.

Kind Regards,