Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ 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

Save Automatically?

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

              
                <h1>Example of embedding the Ethical Book Search widget</h1>

<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.</p>

<div id="ethical-book-search-container">
  <noscript>
    <p>
      Find a responsible bookseller for the book you want to buy with <a href="https://www.ethicalbooksearch.com/">Ethical Book Search</a>.
    </p>
  </noscript>
</div>

<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.</p>

<p>The Ethical Book Search was embedded in the page by including the following code near the base of the page.</p>

<code>
  <pre>
&lt;script type="text/javascript" src="https://www.ethicalbooksearch.com/widget.js">&lt;/script>
&lt;script type="text/javascript">EBSWidget.setUp("/", "your-source-name");&lt;/script> 
  </pre>
</code>

<p>
  If you want to embed the results for <a href="https://www.ethicalbooksearch.com/uk/editions/9781509880829">a particular book on Ethical Book Search</a> you can either replace the first argument to <code>EBSWidget.setUp</code> with the path for the book e.g.
</p>

<code>
  <pre>
&lt;script type="text/javascript" src="https://www.ethicalbooksearch.com/widget.js">&lt;/script>
&lt;script type="text/javascript">EBSWidget.setUp("/editions/9781509880829", "your-domain-name");&lt;/script> 
  </pre>
</code>

<p>
  Or by adding an <code>ebs_path</code> query string to the surrounding page's URL. For example see <a href="https://ethicalrevolution.co.uk/amazon-alternatives/?ebs_path=%2Feditions%2F9781509880829">https://ethicalrevolution.co.uk/amazon-alternatives/?ebs_path=%2Feditions%2F9781509880829</a>. 
</p>
  
  
<script
  type="text/javascript"
  src="https://www.ethicalbooksearch.com/widget.js">
</script>
<script type="text/javascript">
  EBSWidget.setUp("/", "your-source-name");
</script> 
              
            
!

CSS

              
                #ethical-book-search-container iframe {
  width: 100%;
  border: 0px;
}


              
            
!

JS

              
                
              
            
!
999px

Console