Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7885281
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T05:01:16+00:00 2026-06-03T05:01:16+00:00

I need to do some blog posting. For that i need to paste some

  • 0

I need to do some blog posting. For that i need to paste some code of my program.

I want to make use of this code block similar to this

Similar to this

I tried using code or pre but it didn’t produced the same output.

How to do it in HTML?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T05:01:18+00:00Added an answer on June 3, 2026 at 5:01 am

    You probably want to do it in cascading style sheets (CSS). Create some CSS with the look you want, and things marked as <code> should take on that appearance. For example:

    <html>
    <head>
    <style type="text/css">
    code { background-color: gray; color: blue; }
    </style>
    </head>
    <body>
    <p>Some code:</p>
    <code>My code...</code>
    </body>
    </html>
    

    You can do tons of formatting in CSS. Use <span class="small_block"> for short blocks of text like keywords, or <div class="big_block"> for larger blocks. Create entries for small_block and big_block in the style section in the header to define the look, but please use better class names than those :). Have fun!


    Update: Deep down, the highlighting is properly done through CSS, shown simply and manually above (technically inline styles are possible too, but that is an ugly solution). As the other answers show, there are libraries that can automate the highlighting process, by means of JavaScript that examines and highlights your source code blocks when the page is rendered. They basically provide rich CSS and apply span and div tags automatically, and can apply language-specific rules to make code look very elaborately formatted, like modern IDE editors.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to start writing some blog and I know that i will past
Need some help to solve this. I have a gridview and inside the gridview
Need some help with this problem in implementing with XSLT, I had already implemented
Need some help gathering thoughts on this issue. Our team is moving ahead with
Need some help assigning a mouseover event to display some icons that start out
I believe that I am having a bad database design and need some help
I somehow need a way for the following: User is located at some blog
I need some informative help about animation. Want to add animation in iPhone Application..
I really need some help with forming a MySQL query that I just cannot
I need some jquery plugin as they use it on most flight booking sites

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.