WordPress.org

Ready to get started?Download WordPress

Forums

Making my own code tag? (2 posts)

  1. Suikolove
    Member
    Posted 6 years ago #

    Is it possible for me to create an HTML tag called code2 which adds a border to the area and changes the background color? For example, the tutorials on my blog/site will have random snippets of code thrown in the sentences which uses the code tags, but I want the EXAMPLES of code I put up to be styled differently, since they're much bigger than just a word thrown randomly into a sentence.

    For this, I don't want the codes in the sentences to be affected by the border and the background color change.

    I hope I've explained well enough what I want to do.

    Thanks in advance for any help anyone can offer me.

  2. moshu
    Member
    Posted 6 years ago #

    No, I don't think you can make up your own html tag - that would be a chaos on the internet.

    However, you can define as many divs or spans in your stylesheet as many you want.

    Another option could be to use a code highlighting plugin as do many WP users who publish tutorials and also show code.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.