About 1,930,000 results
Open links in new tab
  1. Styling Code In and Out of Blocks - CSS-Tricks

    Jan 6, 2021 · The :not(pre) code selector matching <body> can easily be fixed with :not(pre) > code. This will target <code> blocks that don’t have a <pre> tag as the immediate parent, which decouples the CSS from requiring a .post ancestor. Naturally the same works for pre > code to target <code> tags directly within <pre> tags, regardless of where they ...

  2. How to display code snippets in HTML? - Codiga

    Oct 21, 2022 · Looking for a way to display code snippets in HTML and want to showcase your code on your blog? Check out this quick tutorial with examples.

  3. html - How can I style code listings using CSS? - Stack Overflow

    If you want even better-looking code, you can employ Google Code's Prettify which is used by StackOverflow to color code-snippets. It has it's own stylesheets that it automatically imports based on what language it thinks the code is and colors the code accordingly.

  4. making code block in css look good - Stack Overflow

    Feb 28, 2016 · I am trying to find the right css required to make my code block look good in my Jekyll powered Github Pages blog. I want it the code to look something like this (I'm using kramdown with syntax highlighting):

  5. How to Use Code Examples in HTML - Simmons University

    In order to display the code properly and in an easy to read fashion, we need to style the <code> block. This page uses the following CSS styles to display the code block: background-color: #eee; border: 1px solid #999; display: block; padding: 20px; You …

  6. How to Use HTML Code Blocks for Better Website Design - DhiWise

    Oct 29, 2024 · HTML code blocks are a powerful tool for displaying computer code on your website. They can be styled with CSS to match your site's design and enhanced with JavaScript libraries for syntax highlighting and line numbers.

  7. HTML Code Blocks - Quarto

    There are wide variety of options available to customize the display of source code within HTML documents, including: Hiding some or all code that was executed by Knitr or Jupyter. Code folding for executed code (hidden by default and expandable by readers). Handling code that overflows the available horizontal display space.

  8. How to Write Code Blocks in HTML - Delft Stack

    Feb 2, 2024 · This article will introduce a few methods of writing blocks of code snippets in HTML. Wrap the <code> Tag and Its Contents Inside the <pre> Tag to Write Code Block in HTML. The <code> tag defines a piece of computer code. The content inside is displayed in the browser’s default monospace font. The tag is used to represent code blocks in HTML ...

  9. Creating Stylish Code Snippets: HTML and CSS Guide - Code with …

    Sep 23, 2023 · Learn how to create elegant code snippets using HTML and CSS. Improve your frontend skills with our step-by-step guide. Code snippets play a vital role in the world of web development. They are bite-sized pieces of code that can be …

  10. css - How to use code blocks in HTML - Stack Overflow

    Apr 30, 2012 · 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 :).

  11. Some results have been removed
Refresh