Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <div class="container">
	<p>
		<span class="highlighter_01">SAMPLE 01</span>
		<span class="highlighter_02">SAMPLE 02</span>
		<span class="highlighter_03">SAMPLE 03</span>
		<span class="highlighter_04">SAMPLE 04</span>
		<span class="highlighter_05">SAMPLE 05</span>
		<span class="highlighter_06">SAMPLE 06</span>
		<span class="highlighter_07">SAMPLE 07</span>
		<span class="highlighter_08">SAMPLE 08</span>
		<span class="highlighter_09">SAMPLE 09</span>
		<span class="highlighter_10">SAMPLE 10</span>
			
		</p>
</div>
<a href="https://1-notes.com/css-text-highlighter-design/" target="_blank" rel="noopener">CSS | Text highlighter design | ONE NOTES</a>

              
            
!

CSS

              
                body{
	padding: 0;
	margin: 0;
}

.link {
	padding: 10px;
}

.container{
	padding: 10px;
}

.container p{
	font-size: 20px;
	padding: 0;
	margin: 0;
}

.highlighter_01 {
	background: linear-gradient(transparent 10%, #FF9100 10% 90%, transparent 90%);
}

.highlighter_02 {
	background: linear-gradient(transparent 40%, #00B0FF 40% 90%, transparent 90%);
}

.highlighter_03 {
	background: linear-gradient(transparent 10%, #00E676 10% 40%, transparent 40%);
}

.highlighter_04 {
	background: linear-gradient(transparent 30%, #FF7043 30% 60%, transparent 60%);
}

.highlighter_05 {
	background: linear-gradient(transparent 60%, #FF5252 60% 90%, transparent 90%);
}


.highlighter_06 {
	position: relative;
}

.highlighter_06::before {
	content: "";
	width: 100%;
	height: 80%;
	position: absolute;
	top: 10%;
	left: 0;
	background: linear-gradient(45deg, transparent 0%, #FF9100 0% 40%, transparent 100%);
	z-index: -1;
}

.highlighter_07 {
	position: relative;
}

.highlighter_07::before {
	content: "";
	width: 100%;
	height: 50%;
	position: absolute;
	top: 40%;
	left: 0;
	background: linear-gradient(45deg, transparent 0%, #00B0FF 0% 40%, transparent 100%);
	z-index: -1;
}

.highlighter_08 {
	position: relative;
}

.highlighter_08::before {
	content: "";
	width: 100%;
	height: 30%;
	position: absolute;
	top: 10%;
	left: 0;
	background: linear-gradient(45deg, transparent 0%, #00E676 0% 40%, transparent 100%);
	z-index: -1;
}

.highlighter_09 {
	position: relative;
}

.highlighter_09::before {
	content: "";
	width: 100%;
	height: 30%;
	position: absolute;
	top: 30%;
	left: 0;
	background: linear-gradient(45deg, transparent 0%, #FF7043 0% 40%, transparent 100%);
	z-index: -1;
}

.highlighter_10 {
	position: relative;
}

.highlighter_10::before {
	content: "";
	width: 100%;
	height: 30%;
	position: absolute;
	top: 55%;
	left: 0;
	background: linear-gradient(45deg, transparent 0%, #FF5252 0% 40%, transparent 100%);
	z-index: -1;
}


              
            
!

JS

              
                
              
            
!
999px

Console