Code Blocks Overview
Code blocks in Tettra pages allow you to feature formatted code. They look like this:
This is a code block.
Here are three common use cases:
Sharing a code snippet
You can share a small code snippet with your team using a code block. Here's an example of a short SQL query in a code block:
SELECT * FROM listings
WHERE host_id=12345678
GROUP BY [columnsī¸]
Making text stand out
A code block can be an alternative to a callout box. Here they are next to each other for comparison:
This is a code block.
This is a callout box.
As a caption for an image
An image will most often be centered in your Tettra page. You can use a code block to insert a caption beneath it, like this:
![twwWjKlL9UbcStlxX4xHn42FMQudKPCNgrFDN6Qa.png](https://tettra-staging.s3.us-west-2.amazonaws.com/e6a3bb5fe35e561dc6df46f32b85a124/1a8a5ef0a226cb4015308a8adf270437/20993de870e0114a29c4be3f8daa2907/222e5dcb6f43dd35c8ba40a18331fa14/twwWjKlL9UbcStlxX4xHn42FMQudKPCNgrFDN6Qa.png)
This is a cheerful pirate ship firing a cannonball.