Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ 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

Auto Save

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

              
                <!-- these two divs are for formatting purposes -->
<div class="chatter">
	<div class="log">

		<h2>
			<!-- your title clearly goes in this section -->Fancy some tea...?
		</h2>

		<div class="them">
			<span>
				<!-- the username of the person you are talking to goes after the span tag -->Bengals1985
			</span>

			<!-- whatever your conversation partner says follows -->I can't believe jerry did <em>that</em>...
		</div>

		<div class="you">
			<span>
				<!-- your username goes here, following the span tag -->Lost D3mon
			</span>
			<!-- following this, write what you yourself said, haha -->She still hasn't told him she's pregnant yet, either!
		</div>

		<!-- this ends the example of two lines of chat, between two people. everything after this is just further examples of the same code with different content -->
		<div class="them">
			<span>Bengals1985</span>
			And he has no idea what she's planning next with Ryan...
		</div>

		<div class="you">
			<span>Lost D3mon</span>
			Do you think she knows about jerry and jenny?
		</div>

		<div class="them">
			<span>Bengals1985</span>
			I heard from that girl who runs the site with the purple gifs that she'll find out <strong>really</strong> soon though...
		</div>

		<div class="you">
			<span>Lost D3mon</span>
			I wonder how she'll react when she finds out the truth. Ryan totally played them all...
		</div>

		<div class="them">
			<span>Bengals1985</span>
			She's going to be heartbroken, no doubt about it. I hate spoilers.........
		</div>

		<div class="you">
			<span>Lost D3mon</span>
			lol this next episode better not mess up jerry's characterization even more.i wish the tv show was more like the book!
		</div>

	</div>
</div>
</body>

</html>
              
            
!

CSS

              
                body {
	font-family: monospace;
	background-color: #f8a4a1;
}

/* below styles the entire container of the chatlog */
.chatter {
	width: 50%;
	margin: 2em auto; /* please change width of this div as you fancy, as well as top-bottom margin, but if you leave the left-right margins set to auto, it will remain centered wherever you place it, of course */
	padding: 1em;
	background-color: #ffdcdc;
	border-radius: 5px;
}

/* this class of subheading styles the title of the whole chatlog at the beginning of it */

.log h2 {
	margin: 0 0 0.5em 0;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	padding: 0.3em;
	vertical-align: middle;
	color: #fff8f8;
	text-align: center;
	background-color: #ae5653;
	border-radius: 5px;
}

/* some formatting to provide a cute gap between each message - edit the size of it as you wish */
.log {
	display: flex;
	flex-direction: column;
	gap: 0.4em;
}

/* this class styles an individual message, including the username */
.them,
.you {
	padding: 0.5em;
	vertical-align: middle;
	background-color: #fff8f8;
	border-radius: 5px;
}
/* the below class styles things said by other people */

.them span {
	font-weight: bold;
	text-transform: uppercase;
	margin-right: 0.2em;
	color: #da7777;
}

/* the below class styles things said by you */
.you span {
	font-weight: bold;
	text-transform: uppercase;
	color: #ae5653;
	margin-right: 0.2em;
}

/* this portion simply adds a colon after each username */
.them span::after,
.you span::after {
	content: ":";
	font-family: courier new;
}

/* notice that this does not compensate for links, because i am operating under the assumption that your chatlogs won't likely contain them. make sure the link color you're already using doesn't conflict with the background (etc) of the chatlog container */

              
            
!

JS

              
                
              
            
!
999px

Console