HTML preprocessors can make writing HTML more powerful or convenient. For instance, Markdown is designed to be easier to write and read for text documents and you could write a loop in Pug.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. So you don't have access to higher-up elements like the <html>
tag. If you want to add classes there that can affect the whole document, this is the place to do it.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. If you need things in the <head>
of the document, put that code here.
The resource you are linking to is using the 'http' protocol, which may not work when the browser is using https.
CSS preprocessors help make authoring CSS easier. All of them offer things like variables and mixins to provide convenient abstractions.
It's a common practice to apply CSS to a page that styles elements such that they are consistent across all browsers. We offer two of the most popular choices: normalize.css and a reset. Or, choose Neither and nothing will be applied.
To get the best cross-browser support, it is a common practice to apply vendor prefixes to CSS properties and values that require them to work. For instance -webkit-
or -moz-
.
We offer two popular choices: Autoprefixer (which processes your CSS server-side) and -prefix-free (which applies prefixes via a script, client-side).
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.
You can apply CSS to your Pen from any stylesheet on the web. Just put a URL to it here and we'll apply it, in the order you have them, before the CSS in the Pen itself.
You can also link to another Pen here (use the .css
URL Extension) and we'll pull the CSS from that Pen and include it. If it's using a matching preprocessor, use the appropriate URL Extension and we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
JavaScript preprocessors can help make authoring JavaScript easier and more convenient.
Babel includes JSX processing.
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.
You can apply a script from anywhere on the web to your Pen. Just put a URL to it here and we'll add it, in the order you have them, before the JavaScript in the Pen itself.
If the script you link to has the file extension of a preprocessor, we'll attempt to process it before applying.
You can also link to another Pen here, and we'll pull the JavaScript from that Pen and include it. If it's using a matching preprocessor, we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
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.
Using packages here is powered by esm.sh, which makes packages from npm not only available on a CDN, but prepares them for native JavaScript ESM usage.
All packages are different, so refer to their docs for how they work.
If you're using React / ReactDOM, make sure to turn on Babel for the JSX processing.
If active, Pens will autosave every 30 seconds after being saved once.
If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.
If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.
Visit your global Editor Settings.
<div class="container-fluid" style="margin-top: 10px">
<div class="table-row header">
<div class="column index">#</div>
<div class="wrapper attributes">
<div class="wrapper title-comment-module-reporter">
<div class="wrapper title-comment">
<div class="column title">Title</div>
<div class="column comment">Comment</div>
</div>
<div class="wrapper module-reporter">
<div class="column module">Module</div>
<div class="column reporter">Reporter</div>
</div>
</div>
<div class="wrapper status-owner-severity">
<div class="wrapper status-owner">
<div class="column status">Status</div>
<div class="column owner">Owner</div>
</div>
<div class="column severity">Severity</div>
</div>
</div>
<div class="wrapper icons">
<div title="Watch" class="column watch">
<span class="glyphicon glyphicon-eye-open"></span>
</div>
<div title="Add comment" class="column add-comment">
<span class="glyphicon glyphicon-comment"></span>
</div>
</div>
<div class="wrapper dates">
<div class="column date">Created</div>
<div class="column date">Updated</div>
<div class="column date">Due</div>
</div>
</div>
<div class="table-row">
<div class="column index">1</div>
<div class="wrapper attributes">
<div class="wrapper title-comment-module-reporter">
<div class="wrapper title-comment">
<div class="column title">App crashes when dragged by title bar</div>
<div class="column comment">Eddie, can you please take a look. We want this fixed pretty soon.</div>
</div>
<div class="wrapper module-reporter">
<div class="column module">Main App</div>
<div class="column reporter">Ravan</div>
</div>
</div>
<div class="wrapper status-owner-severity">
<div class="wrapper status-owner">
<div class="column status"><span class="label label-primary">Open</span></div>
<div class="column owner">Eddie</div>
</div>
<div class="column severity high">High</div>
</div>
</div>
<div class="wrapper icons">
<div class="column watch"><span class="glyphicon glyphicon-eye-open active" /></div>
<div class="column add-comment"><span class="glyphicon glyphicon-comment" /></div>
</div>
<div class="wrapper dates">
<div class="column date">Feb-1, 2016</div>
<div class="column date">Mar-13, 2016</div>
<div class="column date">Apr-4, 2016</div>
</div>
</div>
<div class="table-row">
<div class="column index">2</div>
<div class="wrapper attributes">
<div class="wrapper title-comment-module-reporter">
<div class="wrapper title-comment">
<div class="column title">Unable to save the data when using Enter key instead of clicking on submit button.</div>
<div class="column comment">Let me take this up.</div>
</div>
<div class="wrapper module-reporter">
<div class="column module">Save Screen</div>
<div class="column reporter">Kiran</div>
</div>
</div>
<div class="wrapper status-owner-severity">
<div class="wrapper status-owner">
<div class="column status"><span class="label label-primary">Open</span></div>
<div class="column owner">Vasan</div>
</div>
<div class="column severity medium">Medium</div>
</div>
</div>
<div class="wrapper icons">
<div class="column watch"><span class="glyphicon glyphicon-eye-open active" /></div>
<div class="column add-comment"><span class="glyphicon glyphicon-comment active" /></div>
</div>
<div class="wrapper dates">
<div class="column date">Mar-3, 2016</div>
<div class="column date">Apr-4, 2016</div>
<div class="column date">May-15, 2016</div>
</div>
</div>
<div class="table-row">
<div class="column index">3</div>
<div class="wrapper attributes">
<div class="wrapper title-comment-module-reporter">
<div class="wrapper title-comment">
<div class="column title">Improper alignment in Export section</div>
<div class="column comment">Hey, I am not able to reproduct this. Can you please attach a screenshot?</div>
</div>
<div class="wrapper module-reporter">
<div class="column module">Exports</div>
<div class="column reporter">Ravan</div>
</div>
</div>
<div class="wrapper status-owner-severity">
<div class="wrapper status-owner">
<div class="column status"><span class="label label-success">In Progress</span></div>
<div class="column owner">Pieta</div>
</div>
<div class="column severity low">Low</div>
</div>
</div>
<div class="wrapper icons">
<div class="column watch"><span class="glyphicon glyphicon-eye-open" /></div>
<div class="column add-comment"><span class="glyphicon glyphicon-comment active" /></div>
</div>
<div class="wrapper dates">
<div class="column date">Apr-14, 2016</div>
<div class="column date">May-5, 2016</div>
<div class="column date">Jun-6, 2016</div>
</div>
</div>
</div>
/*
* Define the widths: play around with these
* to get a best fit.
*/
@index-width: 25px;
@title-width: 220px;
@comment-width: 120px;
@module-width: 110px;
@reporter-width: 85px;
@status-width: 95px;
@owner-width: 75px;
@severity-width: 80px;
@icon-width: 18px;
@date-width: 110px;
@margin-width: 30px;
/*
* Basic styles, good for a large display. Everything fits in
* one row, no wrapping. All text based cells grow equally.
*/
// Main container - row container
.table-row {
display: flex; display: -webkit-flex;
flex-direction: row; -webkit-flex-direction: row;
flex-wrap: no-wrap; -webkit-flex-wrap: no-wrap;
width: 100%;
padding-left: 15px;
padding-right: 15px;
}
// Wrappers around cells and other wrappers
.wrapper {
display: flex; display: -webkit-flex;
flex-direction: row; -webkit-flex-direction: row;
}
// leaf level containers (cells): common properties
.column {
flex-grow: 0; -webkit-flex-grow: 0;
flex-shrink: 0; -webkit-flex-shrink: 0;
vertical-align: top;
}
// leaf level containers: widths
.index { width: @index-width; }
.title { width: @title-width; }
.module { width: @module-width; }
.reporter { width: @reporter-width; }
.status { width: @status-width; }
.owner { width: @owner-width; }
.severity { width: @severity-width; }
.watch, .add-comment { width: @icon-width; }
.date { width: @date-width; }
// leaf level containers (cells): special properties
.index {
text-align: center;
}
.title {
font-weight: bold;
color: #337AB5;
}
.comment {
width: @comment-width;
}
// these are growable text containers, with ellipsis to show truncated text
.title, .comment {
flex-grow: 1; -webkit-flex-grow: 1;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
padding-right: 4px;
}
.date {
width: @date-width;
text-align: right;
padding-right: 4px;
}
/* growable wrappers */
.title-comment, .title-comment-module-reporter, .attributes {
flex-grow: 1; -webkit-flex-grow: 1;
}
/*
* Media queries: optimize for different screen widths.
*/
// Wrapper widths
@title-comment-width: max(@title-width, @comment-width);
@module-reporter-width: max(@module-width, @reporter-width);
@status-owner-width: max(@status-width, @owner-width);
@title-comment-module-reporter-width: max(@title-width, @comment-width,
(@module-width + @reporter-width) );
@status-owner-severity-width: max(@status-width, @owner-width,
@severity-width);
@all-attributes-width: max(@title-width, @comment-width,
(@module-width + @reporter-width), (@status-width + @owner-width));
.horizontal() {
flex-direction: row; -webkit-flex-direction: row;
}
.vertical() {
// Let the wrapper flex vertically, so we get 2 rows
flex-direction: column; -webkit-flex-direction: column;
// can't have the children grow, since this now means vertical growth
div {
flex-grow: 0; -webkit-flex-grow: 0;
}
}
.vertical-growing() {
.vertical();
> div {
// Let immediate child divs grow horizontally, 100% to fill the wrapper
width: 100%;
}
}
/*
* Media breaks.
*/
// First break: as many 2-row fields as possible. This will leave Severity
// and Dates still horizontal, as they are odd numbered
@media all and (max-width: (@margin-width * 2 + @index-width
+ @title-width + @comment-width + @module-width + @reporter-width
+ @status-width + @owner-width + @severity-width + @icon-width * 2
+ @date-width * 3) ) {
.title-comment {
.vertical-growing();
width: @title-comment-width;
}
.module-reporter, .status-owner {
.vertical();
}
}
// Next: as many 3-rows as possible
@media all and (max-width: (@margin-width * 2 + @index-width
+ @title-comment-width + @module-reporter-width
+ @status-owner-width + @severity-width
+ @icon-width * 2 + @date-width * 3) ) {
// Change module-report back to horizontal, keep it under title and comment
// So, we have 3 rows: title, comment, module-reporter
.module-reporter {
.horizontal();
}
.title-comment-module-reporter {
.vertical-growing();
width: @title-comment-module-reporter-width;
}
// Line up status, owner, severity into the next column
.status-owner-severity {
.vertical();
}
// Line up all icons in one column, even though there's only two of them
.icons {
.vertical();
}
// Line up all dates in one column
.dates {
.vertical();
}
}
// Last break: 4 columns: index, attributes, icons, dates
@media all and (max-width: (@margin-width * 2 + @index-width
+ @title-comment-module-reporter-width + @status-owner-severity-width
+ @icon-width + @date-width) ) {
// looks better with a little padding on mobile devices
.table-row {
padding-left: 4px;
padding-right: 4px;
}
// All attributes: title, comment, module-reporter, status-owner, severity
.attributes {
.vertical-growing();
width: @all-attributes-width;
}
.module-reporter, .status-owner {
.horizontal();
}
}
/*
* General good-look styles
*/
.table-row {
border-bottom: 1px solid #e0e0e0;
border-collapse: collapse;
padding-top: 2px;
}
.table-row.header {
background-color: #FFEEDB;
font-weight: bold;
padding-top: 6px;
padding-bottom: 6px;
}
.glyphicon {
color: #DDDDDD;
}
.header .glyphicon {
color: #333
}
.glyphicon-eye-open.active {
color: blue;
}
.glyphicon-comment.active {
color: #3EBB0D;
}
.glyphicon:hover {
color: #666;
cursor: pointer;
text-decoration: underline;
}
.reporter {
color: #999999;
}
.comment {
font-style: italic;
}
.severity.high { color: red; }
.severity.medium { color: blue; }
.severity.low { color: green; }
Also see: Tab Triggers