HTML/CSS Code Snippets
Below are several brief how-to articles for implementing pleasing and useful styles in Pressbooks. These were largely developed by staff and students working in the OER Design Studio — perhaps you will have something of your own to contribute!
Fix Padding/Margins Around Headings
The amount of spacing around headings is dictated by the Pressbooks theme you have chosen, and may contain more padding than you would like. Remember when editing the Custom Styles Sheet, you can customize the Web, PDF, and eBook versions. If you want the change to occur across all three formats, you will need to copy the code to each drop-down (top).
The amount of padding around a heading can be adjusted using Custom Styles. Changes will remain consistent throughout the text.
- On the Dashboard, select Appearance then Custom Styles
- In the Your Web Styles box, add the CSS shown below
- Adjust the padding size by increasing or decreasing the number after margin-bottom: and margin-top:
/* Bold heading h3 */
.chapter h3{
margin-bottom:0.5;
}
main *+p {
margin-top: 0em;
}
NOTE: This particular code adjusts heading 3. Change the heading number to adjust a different heading (.chapter h1, .chapter h2 etc.). If you would like to change the spacing around every heading, use the code below.
/* bold headings h1 - h4 */
.chapter h1, .chapter h2, .chapter h3, .chapter h4 {
margin-bottom: 1em ;
}
main *+p {
margin-top: 0em;
}
Rounded Textbox Corners
Place the following in Custom Styles:
.textbox, .textbox p {
hyphens: none;
border-radius: 1.5em !important;
}
.textbox__header {
border-radius: 1.5em 1.5em 0 0 !important;
}
Icons in Textbox Headers
Place the code below in Custom Styles. Note the use of ::before (known as a pseudo-element). A full list of CSS pseudo-elements can be found here: https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-elements
/*Icons in textbox headers*/
h2.textbox__title {
margin: 0;
}
.textbox--learning-objectives .textbox__header::before,
.textbox--exercises .textbox__header::before,
.textbox--examples .textbox__header::before,
.textbox--key-takeaways .textbox__header::before {
content: "";
display: block;
background-size: contain;
width: 50px;
height: 50px;
background-position: center;
}
/* Learning Objectives Box */
.textbox--learning-objectives .textbox__header::before {
background-image: url("IMG_URL_HERE");
}
/* Question/Exercises Box */
.textbox--exercises .textbox__header::before {
background-image: url("IMG_URL_HERE");
}
/* Examples Box */
.textbox--examples .textbox__header::before {
background-image: url("IMG_URL_HERE");
}
/* Key Takeaways Box */
.textbox--key-takeaways .textbox__header::before {
background-image: url("IMG_URL_HERE");
}
/* No-Icon */
.textbox-no-icon::before {
display: none !important;
background: none !important;
}
/*End of icons in textbox headers*/
Basic Accordion
The following HTML element allows for content to hidden and displayed when a user clicks on it:
Accordion Header (could be a question)
Hidden text (could be the answer to the question posed above).
To include this accordion, use the following HTML in your page at the desired spot using the Text Editor:
<details>
<summary><strong>Accordion Header (could be a question)</strong></summary>
Hidden text (could be the answer to the question posed above).
</details>
Fancy Accordion (With Shading and Borders)
Header Content Here
HIDDEN TEXT HERE
To apply the styling above, apply the following HTML page code in the Text Editor:
<div class="fancy-accordion-wrapper">
<details class="fancy-accordion"><summary> Header Content Here </summary>
<div class="collapsed">
HIDDEN TEXT HERE
</div>
</details>
</div>
Then copy/paste the following into Custom Styles:
/*Fancy Accordion*/
.fancy-accordion-wrapper {
margin-bottom: 60px;
position: relative;
}
details.fancy-accordion {
margin-bottom: -45px;
border-radius: 15px;
border: 1px solid #0b6396;
padding: 0px;
}
details.fancy-accordion > summary {
padding: 10px;
font-size: 1.25em;
text-indent: 30px;
background-color: #0b6396;
color: #fff;
border: none;
cursor: pointer;
border-radius: 10px 10px 10px 10px; }
details.fancy-accordion[open] > summary {
background-color: #0b6396;
color: #fff;
border-radius: 10px 10px 0 0;
}
.collapsed {
/*border-radius: 10px;
border: 2px solid #0b6396;*/
padding: 20px;
margin-bottom: 10px; }
/* # The Rotating Marker # */
details.fancy-accordion summary::marker {
display: none;
content: ""; }
details.fancy-accordion summary::before {
content: "▶";
left: -0.6em;
position: absolute;
transform: rotate();
transform-origin: 70% 50%;
transition: 0.2s transform ease; }
details.fancy-accordion[open] > summary:before {
transform: rotate(90deg);
transform: ease 1s; }
/* # The Sliding Summary # */
@keyframes details-show {
from {
opacity: 0;
transform: var(--details-translate, translateY(-0.5em)); } }
details.fancy-accordion[open] > *:not(summary) {
animation: details-show 750ms ease-in-out; }
/* End of Accordion */
Left Bar Text Decoration
The above effect can be achieved applying a custom class to the page HTML and then using a global style in Custom Styles. In the Text Editor, apply the class to any text you want to accentuate with the left bar, for example:
<div class="leftbar">Left Bar Text</div>
/*Text accent - indent & left coloured bar*/
.leftbar {
border-left: 10px solid teal; /* the bar */
padding-left: 10px;
margin-left: 10px;
}
Note that you can control the colour and width of the bar using the “border-left” property. You could even have several different bars with varying colours, for example, by defining a custom class for each.
Below is the implementation for a similar effect with the text enclosed in a box (remember to apply the class in the page HTML):
/*Box with left accent bar*/
.box {
border-top: 1px solid teal;
border-right: 1px solid teal;
border-bottom: 1px solid teal;
border-left: 15px solid teal;
padding: 10px;
}
Figure (Gives Greater Control Over Captioning)
To use the Figure element, place the following HTML in your page using the Text Editor:
<figure>
<img src="YOUR_IMAGE.jpg" alt="ALT-TEXT" style="width:100%">
<figcaption>Fig.1 - MY IMAGE</figcaption>
</figure>
The <figure>
tag will house the <figcaption>
tag and you can choose where you would like to place the caption (above or below) in relation to the content. You can place an image, but remember the image caption is different from the figcaption. The figure doesn’t have to be an image, the figure could be a table, just move whatever HTML pertains to the figure inside the figure tags. Styles can be applied to the <figure>
and <figcaption>
elements using CSS, either inline or in Custom Styles. See https://www.w3schools.com/tags/tag_figure.asp for more details.
Hanging Indent (For APA References)
In order to list references with hanging indents, for example:
Anthony, S. (2009). Major League Innovation. Harvard Business Review. https://hbr.org/2009/10/major-league-innovation
Format each reference like this in the page Text Editor:
<p class="hanging-indent" style="text-align: left;">REFERENCE TEXT</p>
Rounded Image Borders
Rounding the corners on images is achieved the same way as with any other HTML element – by using the border-radius
CSS property. You can do this either inline to apply to a single image, or in the Custom Styles editor using a custom class or applied to all images using the img
selector. For example, the following would be placed in the page HTML Text Editor to round the corners of a single image and apply a grey border:
<img src="IMAGE SOURCE" style="border-radius: 10%; padding: 3px; border: 1px solid grey;" />
For the above style to apply to all images in the book, place the following in the Custom Styles editor:
img {
border-radius: 10%;
padding: 3px;
border: 1px solid grey;
}
Table Template (Rounded corners, alternating row shading)
Example Header |
---|
Example Content… |
Example Content… |
Example Content… |
If you are not familiar with how tables are represented in HTML, please check out the article at https://www.freecodecamp.org/news/html-tables-table-tutorial-with-css-example-code/ before applying advanced styling to tables.
To apply the above template, first add the tableDesign1 custom class to your table in the page HTML Text Editor:
<table class="tableDesign1">
. . .
</table>
Copy and paste the CSS below into the Custom Styles (take note of style options indicated by the comments):
/* tableDesign1 template */
table.tableDesign1{
border: none !important;
width: 100% !important;
border-radius: 1em !important;
margin: 0 !important;
}
/* this formats the first row as a header row, with blue background and white text */
table.tableDesign1 th, table.tableDesign1 tr:first-of-type td {
color: white !important;
background-color: #0b6396 !important;
padding-left: 1.5em;
}
.tableDesign1 tr:first-of-type{
border-bottom: solid black 1px;
background-color: #0b6396 !important;
}
/* apply rounded corners to table */
.tableDesign1 th:first-of-type{
border-top-left-radius: 1.5em;
}
.tableDesign1 tr:last-of-type td:first-of-type{
border-bottom-left-radius: 1.5em;
}
.tableDesign1 tr:last-of-type td:last-of-type{
border-bottom-right-radius: 1.5em;
}
.tableDesign1 tr:first-of-type td:first-of-type{
border-top-left-radius: 1.5em;
}
.tableDesign1 tr:first-of-type th:last-of-type, .tableDesign1 tr:first-of-type td:last-of-type{
border-top-right-radius: 1.5em;
}
.tableDesign1 td{
padding-left: 1.5em !important;
}
/* alternating row colours */
.tableDesign1 tr:nth-child(even), .giveMePretty {background: #CCC};
.tableDesign1 tr:nth-child(odd), .giveMePretty {background: #f0f6ff}
/* End of tableDesign1 */
Rounded YouTube Video Embedding
To apply the above style to videos (only works with YouTube embeds), use the following code in your page HTML (Text Editor):
<div style="border: solid black 5px; border-radius: 1.5em;">
<div style="border-radius: 1.1em; overflow: hidden; background-color: #f0f6ff;">
YOUTUBE EMBED LINK GOES HERE
<p style="text-align: center; margin: 1em;">Video: "<a href="LINK TO YOUTUBE VIDEO">VIDEO TITLE</a>" By VIDEO AUTHOR [VIDEO DURATION]</p>
</div>
</div>
Change Lightbox Background Colour
If you have images with transparent backgrounds that don’t show up properly in the lightbox, insert the following in the Custom Styles editor (this will add a white background underneath the image):
/* Change lightbox background colour */
.lity-content {
background-color: white !important;
padding: 2rem;
}
Format Headings
To make all text in heading font bold in the book, add the following to the Custom Styles:
/* bold all headings */
h1, h2, h3, h4, h5, h6 {
font-weight: bold !important;
}
Note that you have a lot of control over the format of headings using CSS in the Custom Styles editor. For example, if you want all Heading 2 text in only the Parts to be blue and italic, you can do so like this:
/* part heading 2 text to blue and italic */
part h2 {
color: blue !important;
font-style: italic !important;
}
Editing Marks (Strikethrough, Underline)
The following will allow you to mark text as crossed out or deleted in a way that is accessible to people using screen readers.
- Signify text that has been crossed out:
<span role="deletion">The deleted text.</span>
- Signify text that has been inserted:
<span role="insertion">The inserted text.</span>
In addition, the following must be added to the Custom Styles:
/*Editing Marks*/
[role="insertion"] {
color: #1215b0;
text-decoration: underline;
}
[role="deletion"] {
color: #be0000;
text-decoration: line-through;
}
It would look as follows:
- This is the deleted text.
- This is the inserted text
Circle Text / Section
Here is how you can have a word or section of text circled:
<span style="border: 1px solid; border-radius: 30px; padding: 3px;">This text is circled.</span>
It would look like this:
This text is circled.
Note that if you want to be able to apply this style in multiple places, you should apply a custom class to the text being circled and put the CSS styling in the Custom Styles. For example, on the page in the Text Editor you would have:
<span class="circled">This text is circled</span>
And in Custom Styles, add:
/*Circled Text*/
.circled{
border: 1px solid black;
border-radius: 30px;
padding: 3px;
}
/*End of Circled Text*/
Bulleted and Numbered List Formatting
The following can be used to customize lists. This is especially useful when you have sublists that are not numbering how you want them.
- Lowercase letters:
<ol type="a">
- Capital letters:
<ol type="A">
Roman numerals:
<ol type="I">
To start numbering from the number “3”:
<ol start="3">
- Two columns:
<ul class="twocolumn">
- Three columns:
<ul class="threecolumn">
li style="break-inside: avoid;">
Quote Box
How wonderful it is to display quotes in their own box!
— An OER Instructional Designer
To achieve the above effect, use code following this format on the page:
<div class="textbox quote-box">
<div class="quote-box_icon" ></div>
<p style="text-align:left;">How wonderful it is to display quotes in their own box!</p>
<p style="text-align:left; font-style:normal"> -- An OER Instructional Designer</p>
</div>
You’ll need to add the quote icon you wish to use to the Media Library and make a copy of its Pressbooks URL. Add the following CSS in the Custom Styles (note where you need to paste the URL for your icon):
/* quote-box styling */
.quote-box {
position: relative;
border-color: darkgray !important;
border-width: 2px;
}
.quote-box_icon {
content: url("[PASTE ICON URL HERE]");
position: absolute;
display: inline-block;
width: 45px;
left: -22px;
top: 50%;
transform: translateY(-50%);
}
.quote-box p {
font-style: italic;
/*You may have to play with margin and padding values for desired look*/
margin-left: 5em;
padding: 2em;
}
.quote-box p:first-of-type:first-letter {
font-size: 24px;
font-weight: bold;
line-height: 0.2em;
}
/* end of quote-box */
Table with Alternating Row Colours / TablePress Replacement
Heading 1 | Heading 2 | Heading 3 |
---|---|---|
Row 1, Col 1 | Row 1, Col 2 | Row 1, Col 3 |
Row 2, Col 1 | Row 2, Col 2 | Row 2, Col 3 |
Row 3, Col 1 | Row 3, Col 2 | Row 3, Col 3 |
To achieve the above effect, apply the alternating
class inside your <table>
tag, then paste the following into the Custom Styles:
/* Table with alternating row colours */
table.alternating tr:nth-child(even){
background: #f5faff !important;
}
table.alternating tr td:first-child{
padding-left: 1em;
}
table.alternating tr:nth-child(odd){
background: #daeaf5 !important;
}table.alternating td {
padding-left: 1em;
}
table.alternating th {
background: #0b6396;
color: #fff;
padding-left: 1em;
}
TablePress to HTML Instructions
Since there are issues with exporting TablePress tables to PDF, it is often desirable to convert tables generated in TablePress to HTML. Many designers may use TablePress because of its ability to autogenerate tables from imported datasets and the convenience of its visual editor. Using the alternating coloured HTML table, we can provide a similar look to the tables created in TablePress while overcoming the PDF export issues. Simply navigate to the table in the TablePress editor and export it to HTML. Add the generated HTML in the Text editor at the desired position and remember to add the alternating
class to the table and the accompanying styling in the Custom Styles as detailed above.
Banner Image Overlayed with Text
To Achieve the above effect add the following HTML and embed the desired banner image.
<div class="image-container">
EMBED YOUR BANNER IMAGE HERE
<div class="overlay-text">YOUR BANNER TEXT GOES HERE</div>
</div>
You will need to add the desired banner image to the media library. Additionally, add the following CSS to the books custom styling and potentially adjust the colour of the banner text to make it legible, and/or adjust the CSS properties to move the text to an appropriate spot above the image.
.image-container {
position: relative;
display: inline-block;
}
.image-container img {
display: block;
width: 100%;
height: auto;
}
.overlay-text {
//These values will adjust the space above the image which the text lies on, they will have to be adjusted to fit the banner you are making use of
//background-color: #000000; //this line can be uncommented to better display the space in which the text will lie above the image
position: absolute;
top: 50%;
left: 50%;
transform: translate(-26.5%, -55%);
width: 63.5%;
height: 73.5% fit-content !important; //fit-content will vertically align the text within the alloted space. It can be removed if this effect is undesired
//these values can be adjusted to change the appearance of the text
color: #fff;
font-size: 1.20em;
font-family: "Montserrat", sans-serif;
padding: 10px 20px;
font-weight: bold;
line-height: 1.2857142857em;
text-align: center;
hyphens: none !important; //this line will disable hyphenation across lines and can be disabled if this effect is undesired
}
@media only screen and (max-width: 600px) {
//You will also need to make adjustments for how the text will appear and overlay the image on a mobile setup. Again, all of these values will need to be adjusted to fit the banner image you are making use of.
.overlay-text {
width: 70%;
font-size: 0.58em;
line-height: 1.1em;
}
}
Adjust Vertical Spacing Between Images
By default, Pressbooks adds a lot of bottom margin to images. This can be adjusted by using a custom class, but note that you must apply the the custom class inside the opening shortcode, NOT the
<img>
tag. Below is an example — “img-sm-vspace” is the name of the custom class, and the class attribute should be the only part added to the existing image shortcode (do NOT copy this entire shortcode example into your book):
[caption id="PRESSBOOKS ASSIGNED ID" class="img-sm-vspace" ...
Then edit your custom styles to adjust the top and bottom margins applied to this class:
/* vertical spacing for images */
.img-sm-vspace {
margin-top: 1em !important; /* adjust as necessary */
margin-bottom: 1em !important; /* adjust as necessary */
}
Mobile Responsive Image Boxes
Note: These boxes will not format properly without an image.
Info Box
Example Title
This is an example of the content inside the box. You can use this area to provide additional information, examples, or any other relevant text for your textbook.
HTML
<div class="info-box">
<div class="content">
<h2>Example Title</h2>
<p class="example-content">This is an example of the content inside the box. You can use this area to provide additional information, examples, or any other relevant text for your textbook.</p>
</div>
<div class="example-image"><a href="https://ecampusontario.pressbooks.pub/app/uploads/sites/3671/2024/01/bw-dog.png"><img class="rounded-image wp-image-890 alignnone" src="https://ecampusontario.pressbooks.pub/app/uploads/sites/3671/2024/01/bw-dog.png" alt="A black and white photo of a dog looking at the camera." width="177" height="133" /></a></div>
</div>
CSS
.info-box {
width: 100%;
border-radius: 1em;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
padding: 5px;
display: flex;
align-items: center;
justify-content: space-between;
margin: 20px auto;
flex-direction: row;
}
.info-box h2 {
margin: 10px !important;
text-align: center !important;
}
.info-box .content {
flex: 1;
display: flex;
flex-direction: column;
justify-content: center;
}
.content {
padding: 10px;
}
.rounded-image {
border-radius: 2em;
width: 200px;
}
@media (max-width: 768px) {
.info-box {
flex-direction: column;
margin: 10px auto;
align-items: center;
}
.info-box .content {
margin-left: 0;
margin-top: 10px;
text-align: center !important;
}
.content p {
text-align: center !important;
}
.example-image {
width: 100%;
display: flex;
align-items: center;
justify-content: center;
}
.rounded-image {
margin: auto;
width: auto;
max-height: 200px;
}
}
Highlight Box
Example Title
This is an example of the content inside the box. You can use this area to provide additional information, examples, or any other relevant text for your textbook.
HTML
<div class="highlight-box">
<div class="content">
<h2>Example Title</h2>
<p class="example-content">This is an example of the content inside the box. You can use this area to provide additional information, examples, or any other relevant text for your textbook.</p>
</div>
<div class="example-image"><a href="https://ecampusontario.pressbooks.pub/app/uploads/sites/3671/2024/01/bw-dog.png"><img class="rounded-image alignnone wp-image-890" src="https://ecampusontario.pressbooks.pub/app/uploads/sites/3671/2024/01/bw-dog.png" alt="A black and white photo of a dog looking at the camera." width="183" height="137" /></a></div>
</div>
CSS
.highlight-box {
width: 100%;
border-radius: 1em;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
padding: 5px;
display: flex;
align-items: center;
justify-content: space-between;
margin: 20px auto;
flex-direction: row;
border-left: 20px solid #b3272d; /* Change this to change highlight colour */
}.highlight-box h2 {
margin: 10px !important;
text-align: center !important;
}.highlight-box .content {
flex: 1;
display: flex;
flex-direction: column;
justify-content: center;
}.content {
padding: 10px;
}.highlight-box p {
margin: 0;
line-height: 1.6;
font-size: 1em;
}.rounded-image {
margin: auto;
width: auto;
max-height: 200px;
border-radius: 2em;
}.highlight-box .example-image figure {
display: flex;
flex-direction: column;
align-items: center;
justify-content: flex-start;
margin: 0 !important;
}@media (max-width: 768px) {.highlight-box {
flex-direction: column;
margin: 10px auto;
align-items: center;
}.highlight-box .content {
margin-left: 0;
margin-top: 10px;
text-align: center !important;
}.content p {
text-align: center !important;
}.example-image {
width: 100%;
display: flex;
align-items: center;
justify-content: center;
}.rounded-image {
margin: auto;
width: auto;
max-height: 200px;
border-radius: 2em;
}
}
Custom Text Boxes With Icons
What Would You Do Box
What Would You Do?
Title
Critical Thinking Questions
- One
- Two
- Three
HTML
<div>
<div class="w-w-y-d">
<div class="wwyd_icon"></div>
<div class="wwyd_title">
<h2>What Would You Do?</h2>
</div>
<div class="wwyd_body">
<h3>Title</h3>
<h4>Critical Thinking Questions</h4>
<ul>
<li>One</li>
<li>Two</li>
<li>Three</li>
</ul>
</div>
</div>
</div>
CSS
/* What Would You Do*/
.w-w-y-d {
border-right: 3px solid gray !important;
border-bottom: 3px solid gray !important;
border-left: 3px solid gray !important;
position: relative;
padding: 2em;
padding-top: 3em;
border-radius: 1em;
}
.w-w-y-d::before {
content: "";
position: absolute;
top: 0;
right: -0.4%;
width: 90%;
height: 20%;
border-top: 3px solid gray !important;
border-right: 3px solid gray !important;
border-radius: 0 1em 0 0;
}
.wwyd_title {
position: absolute;
top: 0px;
left: 50%;
transform: translateX(-50%);
}
.wwyd_body {
padding-top: 20px;
}
.wwyd_icon {
content: url("https://ecampusontario.pressbooks.pub/app/uploads/sites/4058/2024/05/d37f39b2-ddee-4cfe-a7e1-0e8a1a4db818.png"); //Get the local link after uploading the icon to textbook
position: absolute;
display: inline-block;
width: 65px;
left: 2px;
top: -10px;
transform: rotate(-50deg);
}
Link to Learn Box
Link to learn box
HTML
<div class="textbox link-to-learning">
Link to learn box
</div>
CSS
/* Link to learning boxes */
.link-to-learning {
border: 2px solid #65483d !important;
position: relative;
&::before {
content: '';
background-image: url("https://ecampusontario.pressbooks.pub/app/uploads/sites/4475/2024/10/linktolearn_cdp.png"); //replace with an image from the correct book
background-size: contain; /* Control size */
background-repeat: no-repeat;
position: absolute;
display: inline-block;
width: 45px;
height: 45px;
left: -22px;
top: 50%;
transform: translateY(-50%);
}
& > h3 {
text-align: center;
}
}
Steps Box
Steps with text
Content Here
HTML
<div class="stepbox">
<div class="step-number">Step # Here</div>
Content Here
</div>
CSS
.stepbox {
border: 2px solid #b3272d; //Step content border color
padding: 15px;
margin: 30px 0;
border-radius: 10px;
position: relative;
background-color: #ededed; //Step content background color
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
.stepbox h4 {
margin-top: 0;
}
.step-number {
font-size: 1.5em;
color: white;
background-color: #b3272d; //Step number background color
width: 150px;
height: 40px;
line-height: 40px;
text-align: center;
border-radius: 2em;
position: absolute;
top: -25px;
left: -20px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}
Steps with no text
This is step content
HTML
<div class="stepbox-no-text">
<div class="step-number-no-text">1</div>
This is step content
</div>
CSS
/////////////////////Steps Box No Text
.stepbox-no-text {
border: 2px solid #b3272d; //Step content border color
padding: 15px;
margin: 10px 0;
border-radius: 10px;
position: relative;
background-color: #ededed; //Step content background color
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
.step-number-no-text {
font-size: 2em;
color: white;
background-color: #b3272d; //Step number background color
width: 50px;
height: 50px;
line-height: 50px;
text-align: center;
border-radius: 50%;
position: absolute;
top: -25px;
left: -20px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}
Side Steps
Step #1
Step #2
Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit
HTML
<div class="side-step-container">
<div class="side-step">
<h2 class="side-step-header"><span class="side-step-number">Step #1</span></h2>
<div class="side-step-content">Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur</div>
</div>
<div class="side-step">
<h2 class="side-step-header"><span class="side-step-number">Step #2</span></h2>
<div class="side-step-content">
<p>Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit</p>
</div>
</div>
</div>
CSS
/////Side Step Containers
.side-step {
margin-bottom: 0px;
display: flex;
align-items: center;
padding: 10px 0;
border-bottom: 1px solid #ddd;
}
.side-step-header {
background-color: #b3272d; //Step number background color
color: white;
padding: 10px;
border-radius: 5px;
text-align: center;
}
.side-step-number {
color: white;
}
.side-step-content {
border-left: 5px solid #b3272d;//Step content left border color
text-align: center;
padding: 10px;
background-color: #ededed; //Step content background color
border-radius: 0 5px 5px 0;
}
Add Subtle Video Shadows
Video: “Rick Astley – Never Gonna Give You Up (Official Music Video)” by Rick Astley 3:33 is licensed under the Standard YouTube License. Transcript and closed captions available on YouTube.
CSS
#oembed-1 {
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.5);
}
Attribution
“Standard Practices and Workarounds” from BCcampus Open Education Publishing Style Guide by BCcampus OER Production Team is licensed under a Creative Commons Attribution 4.0 International License, except where otherwise noted.