Skip to main content
CSS-Tricks
  • Articles
  • Notes
  • Links
  • Guides
  • Almanac
  • Picks
  • Shuffle
Search

Articles Tagged
pre

3 Articles
{
,

}
Image
Direct link to the article Code blocks, but better
code pre WordPress blocks

Code blocks, but better

Pedro Duarte made a wishlist for styled code blocks in blog posts and documentation, then hand-rolls a perfect solution for that wishlist. For example, a feature to be able to highlight certain lines or words within the code block. The …

Image
Chris Coyier on Jun 1, 2021
Image
Direct link to the article Creating an Editable Textarea That Supports Syntax-Highlighted Code
forms pre syntax textarea

Creating an Editable Textarea That Supports Syntax-Highlighted Code

When I was working on a project that needed an editor component for source code, I really wanted a way to have that editor highlight the syntax that is typed. There are projects like this, like CodeMirror, Ace, …

Image
Oliver Geer on Apr 16, 2021 Updated on Jan 13, 2025
Image
Direct link to the article Considerations for styling the `pre` tag
code pre

Considerations for styling the `pre` tag

You’ve probably used it. It’s that very special tag in HTML that allows for the white space within the tags to actually be honored. For example, four spaces will actually be four spaces! That’s unlike how HTML normally works, where …

Image
Chris Coyier on May 26, 2016 Updated on Jan 14, 2020

CSS-Tricks is powered by DigitalOcean.

Keep up to date on web dev

with our hand-crafted newsletter

DigitalOcean
  • About DO
  • Cloudways
  • Legal stuff
  • Get free credit!
CSS-Tricks
  • Contact
  • Write for CSS-Tricks!
  • Advertise with us
Social
  • RSS Feeds
  • CodePen
  • Mastodon
  • Bluesky
Back to Top
Advertisement