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

              
                
<div class="content">
  <h1>Frankenstein</h1>
  <h3><i>Scroll Down and the Scroll Back to Top button would appear.</i></h3>
<p>
You will rejoice to hear that no disaster has accompanied the commencement of
an enterprise which you have regarded with such evil forebodings. I arrived
here yesterday, and my first task is to assure my dear sister of my welfare and
increasing confidence in the success of my undertaking.
</p>
  
<p>
I am already far north of London, and as I walk in the streets of Petersburgh,
I feel a cold northern breeze play upon my cheeks, which braces my nerves and
fills me with delight. Do you understand this feeling? This breeze, which has
travelled from the regions towards which I am advancing, gives me a foretaste
of those icy climes. Inspirited by this wind of promise, my daydreams become
more fervent and vivid. I try in vain to be persuaded that the pole is the seat
of frost and desolation; it ever presents itself to my imagination as the
region of beauty and delight. There, Margaret, the sun is for ever visible, its
broad disk just skirting the horizon and diffusing a perpetual splendour.
There—for with your leave, my sister, I will put some trust in preceding
navigators—there snow and frost are banished; and, sailing over a calm sea, we
may be wafted to a land surpassing in wonders and in beauty every region
hitherto discovered on the habitable globe. Its productions and features may be
without example, as the phenomena of the heavenly bodies undoubtedly are in
those undiscovered solitudes. What may not be expected in a country of eternal
light? I may there discover the wondrous power which attracts the needle and
may regulate a thousand celestial observations that require only this voyage to
render their seeming eccentricities consistent for ever. I shall satiate my
ardent curiosity with the sight of a part of the world never before visited,
and may tread a land never before imprinted by the foot of man. These are my
enticements, and they are sufficient to conquer all fear of danger or death and
to induce me to commence this laborious voyage with the joy a child feels when
he embarks in a little boat, with his holiday mates, on an expedition of
discovery up his native river. But supposing all these conjectures to be false,
you cannot contest the inestimable benefit which I shall confer on all mankind,
to the last generation, by discovering a passage near the pole to those
countries, to reach which at present so many months are requisite; or by
ascertaining the secret of the magnet, which, if at all possible, can only be
effected by an undertaking such as mine.
</p>
  
<p>
These reflections have dispelled the agitation with which I began my letter,
and I feel my heart glow with an enthusiasm which elevates me to heaven, for
nothing contributes so much to tranquillise the mind as a steady purpose—a
point on which the soul may fix its intellectual eye. This expedition has been
the favourite dream of my early years. I have read with ardour the accounts of
the various voyages which have been made in the prospect of arriving at the
North Pacific Ocean through the seas which surround the pole. You may remember
that a history of all the voyages made for purposes of discovery composed the
whole of our good Uncle Thomas’ library. My education was neglected, yet I was
passionately fond of reading. These volumes were my study day and night, and my
familiarity with them increased that regret which I had felt, as a child, on
learning that my father’s dying injunction had forbidden my uncle to allow me
to embark in a seafaring life.
</p>
  
<p>
These visions faded when I perused, for the first time, those poets whose
effusions entranced my soul and lifted it to heaven. I also became a poet and
for one year lived in a paradise of my own creation; I imagined that I also
might obtain a niche in the temple where the names of Homer and Shakespeare are
consecrated. You are well acquainted with my failure and how heavily I bore the
disappointment. But just at that time I inherited the fortune of my cousin, and
my thoughts were turned into the channel of their earlier bent.
</p>
  
<p>
Six years have passed since I resolved on my present undertaking. I can, even
now, remember the hour from which I dedicated myself to this great enterprise.
I commenced by inuring my body to hardship. I accompanied the whale-fishers on
several expeditions to the North Sea; I voluntarily endured cold, famine,
thirst, and want of sleep; I often worked harder than the common sailors during
the day and devoted my nights to the study of mathematics, the theory of
medicine, and those branches of physical science from which a naval adventurer
might derive the greatest practical advantage. Twice I actually hired myself as
an under-mate in a Greenland whaler, and acquitted myself to admiration. I must
own I felt a little proud when my captain offered me the second dignity in the
vessel and entreated me to remain with the greatest earnestness, so valuable
did he consider my services.
</p>
<p>
And now, dear Margaret, do I not deserve to accomplish some great purpose? My
life might have been passed in ease and luxury, but I preferred glory to every
enticement that wealth placed in my path. Oh, that some encouraging voice would
answer in the affirmative! My courage and my resolution is firm; but my hopes
fluctuate, and my spirits are often depressed. I am about to proceed on a long
and difficult voyage, the emergencies of which will demand all my fortitude: I
am required not only to raise the spirits of others, but sometimes to sustain
my own, when theirs are failing.
</p>
  
</div>

<a href="#" id="scrollToTopButton" style="display: none;">↑</a>
              
            
!

CSS

              
                #scrollToTopButton {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background-color: #0073aa;
  color: white;
  padding: 10px 15px;
  border-radius: 5px;
  text-align: center;
  cursor: pointer;
  z-index: 1000;
  font-size: 16px;
  text-decoration: none;
}
#scrollToTopButton:hover {
  background-color: #005177;
}

.content {
  width: 77%;
  margin: 50px auto;
  font-family: 'Merriweather', serif;
  font-size: 20px;
  color: #6c767a;
  line-height: 1.9;
}

h1{
  font:Merriweather';
}
              
            
!

JS

              
                document.addEventListener("DOMContentLoaded", function() {
  var scrollToTopButton = document.getElementById("scrollToTopButton");

  window.addEventListener("scroll", function() {
    if (window.pageYOffset > 300) {
      scrollToTopButton.style.display = "block";
    } else {
      scrollToTopButton.style.display = "none";
    }
  });

  scrollToTopButton.addEventListener("click", function(e) {
    e.preventDefault();
    window.scrollTo({ top: 0, behavior: 'smooth' });
  });
});
              
            
!
999px

Console