We're evolving to serve you better! This current forum has transitioned to read-only mode. For new discussions, support, and engagement, we've moved to GitHub Discussions.

Highlight text by using the mark tag / And Keyboard Input element

  • #766
    Avatar photo[anonymous]


    I want to use the kbd input element in the text. I am doing this like this:


    Please press Ctrl + Shift + R to re-render an MDN page.


    But there a couple of issues.

    The CSS is not getting applied in rendered post.

    `.kbd {
    background: #eee; color: #333
    border-radius: 3px; border: 1px solid #b4b4b4;
    font-family: Menlo, Monaco, Consolas, Courier New, monospace;
    box-shadow: 0 1px 1px rgba(0, 0, 0, .2), 0 2px 0 0 rgba(255, 255, 255, .7) inset; }`

    Secondly, to use kbd, I need to go to html of the post and manually do this. Is this possible to add an option for KBD and for Mark Tag as well.

    Any help please ?



    Avatar photo[anonymous]

    Any help, Bob?

    Avatar photoBob

    `kbd` is an HTML element, not a CSS class,  so style it the following way:
    `kbd {
    color: etc…

    We do not plan to add it to the editor, it is barely used, all in all, a marginal function.

    Avatar photo[anonymous]

    It worked.

    Thanks 🙂