Site logo

[Resolved] Add heading inside a menu

Home Forums Support [Resolved] Add heading inside a menu

Home Forums Support Add heading inside a menu

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #2524187
    Rostyslav

    Hello I am trying to add an <h3> heading inside a menu to get this: https://i.postimg.cc/MGzFt2Fv/Captura-de-pantalla-2023-02-07-102751.jpg

    My website: Tejados Madrid

    How can I do it?

    Thanks

    #2524393
    David
    Staff
    Customer Support

    Hi there,

    the image link you provided isn’t working for me ?

    #2524412
    Rostyslav

    Just updated

    #2524718
    David
    Staff
    Customer Support

    It is possible to filter the menu item HTML to change the markup, BUT if you do that then it will break the menu styles.
    A lot of the CSS relies on the li > a selector and if you add a H3 there, then those styles will break.

    Just out of curiosity – what is the purpose of that ?

    #2524757
    Rostyslav

    Hello David. Its a SEO purpose. I would like to add it like on this website: https://agenciaseo.eu/.

    I would like to add H3 but not to all elements of the menu, just on few of them.

    Thanks

    #2524791
    David
    Staff
    Customer Support

    Simplest option would be to add the H3 inside the link.
    In HTML 5 this is valid:

    <a href....>
        <h3>The title</h3>
    </a>

    and it is no different semantically to this:

    <h3>
        <a href....>The title</a>
    </h3>

    It also means the the CSS styles won’t break.
    And you can simply edit the Menu and add those tags to the Navigation Label

    #2524809
    Rostyslav

    Hello, but how can I mantaine the previous styles: https://liser-cubiertas.es/

    It changed all.

    #2524812
    David
    Staff
    Customer Support

    Try setting the H2 to inherit using CSS:

    
    .menu-item a h3 {
        color: inherit !important;
        font-size: inherit;
        margin-bottom: inherit;
    }
    #2525042
    Rostyslav

    Hello I added this and its working perfect!

    .menu-item a h3.h3titulo {
        color: inherit !important;
        font-size: inherit;
        margin-bottom: inherit;
    	line-height:66px;
    	font-weight:700;
    	
    }

    Thanks David

    What does inherit means?

    #2525687
    David
    Staff
    Customer Support

    In the theme we set styles on the li > a
    We now have li > a > h3

    The inherit value tells that property to inherit the styles from the elements parent.
    So the H3 will get eg. the margin-bottom from the a

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.