.box {
background-color: #567895;
}
h2 {
background-color: black;
color: white;
}Organizing your CSS / notebook
Organizing your CSS
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
/* This is a CSS comment
It can be broken onto multiple lines. *//* || General styles */
/* … */
/* || Typography */
/* … */
/* || Header and Main Navigation */
/* … */.box {
background-color: red; /* fallback for older browsers that don't support gradients */
background-image: linear-gradient(to right, red, #aa0000);
}/* || GENERAL STYLES */
body {
/* … */
}
h1,
h2,
h3,
h4 {
/* … */
}
ul {
/* … */
}
blockquote {
/* … */
}/* || UTILITIES */
.no-bullets {
list-style: none;
margin: 0;
padding: 0;
}
/* … *//* SITEWIDE */
.main-nav {
/* … */
}
.logo {
/* … */
}/* || STORE PAGES */
.product-listing {
/* … */
}
.product-box {
/* … */
}article.main p.box {
border: 1px solid #cccccc;
}.box {
border: 1px solid #cccccc;
}.comment {
display: grid;
grid-template-columns: 1fr 3fr;
}
.comment img {
border: 1px solid grey;
}
.comment .content {
font-size: 0.8rem;
}
.list-item {
display: grid;
grid-template-columns: 1fr 3fr;
border-bottom: 1px solid grey;
}
.list-item .content {
font-size: 0.8rem;
}.media {
display: grid;
grid-template-columns: 1fr 3fr;
}
.media .content {
font-size: 0.8rem;
}
.comment img {
border: 1px solid grey;
}
.list-item {
border-bottom: 1px solid grey;
}<div class="media comment">
<img src="" alt="" />
<div class="content"></div>
</div><ul>
<li class="media list-item">
<img src="" alt="" />
<div class="content"></div>
</li>
</ul><form class="form form--theme-xmas form--simple">
<label class="label form__label" for="inputId"></label>
<input class="form__input" type="text" id="inputId" />
<input
class="form__submit form__submit--disabled"
type="submit"
value="Submit" />
</form>.alert {
border: 1px solid #c6538c;
}