🎯 Purpose
Designed to display formatted code snippets with syntax highlighting and style options, this widget is perfect for blogs, tutorials, documentation, or developer portfolios.
⚙️ Core Features
Multiple Language Support
Automatically highlights syntax for numerous programming and markup languages (e.g., JavaScript, HTML, CSS, Python, PHP).
Uses an intuitive dropdown to specify the appropriate language.
Editable Code Input
Paste or write code directly into the widget’s content field.
Maintains indentation and formatting for clarity.
Highlight Specific Lines
Mark particular lines to emphasize important segments (e.g., key steps or critical logic).
You can hide or accentuate lines to draw focus where needed.
Line Numbers
Toggle line numbering on or off.
Adjust appearance to match your theme style.
🎨 Style & Layout Options
Typography Controls
Customize font family (monospace is typical), size, weight, letter spacing, and color for readability.
Background & Borders
Set background color, padding, border width, style, radius, and color to make code sections stand out.
Line Number Styling
Separate settings for line number color, typography, and spacing.
Highlighted Line Appearance
Apply distinct styling (background or text color) to emphasized lines.
Responsive Settings
Tweak styling for table, mobile, and desktop devices—line heights and padding can vary per device for optimal readability.
🛠️ Use Cases
Technical blogs or tutorials where code clarity is key.
Documentation pages with sample code blocks.
Developer portfolios showcasing code snippets.
API demos or instructional content requiring code preview.
âś… Best Practices
Select a suitable language to enable correct syntax styling.
Use consistent indentation and formatting for better clarity.
Highlight only the most essential lines—too many highlights reduce impact.
Choose readable fonts, color contrasts, and comfortable padding.
Use responsive options to prevent wrapping or overflow on smaller screens.
Test mobile responsiveness to ensure readability across devices.
The Code Highlight widget in Elementor Pro offers a powerful way to present code elegantly and accessibly.