Pen Settings



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


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


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.


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.


                <div class="wrap">
  <div class="header">
      screenX : <span class="screenX"></span>
      screenY : <span class="screenY"></span>
      pageX : <span class="pageX"></span>
      pageY : <span class="pageY"></span>
      clientX : <span class="clientX"></span>
      clientY : <span class="clientY"></span>
<div class="mouseImg">
  <img width="50" src="
                         " alt="">


                body {
  line-height: 1.6;

  cursor: none;
.wrap {
  background: url( bottom #404747
  max-width: 100%;
  height: 2500px;
.header {
  position: fixed;
  top: 0;
  background: #ceefe4;
  width: 100%;
  height: 80px;
  text-align: center;
  padding: 15px 0;
.mouseImg {
  position: fixed;
    position: fixed;
  /*沒有使用 absol



                const screenX = document.querySelector('.screenX');
const screenY = document.querySelector('.screenY');
const pageX = document.querySelector('.pageX');
const pageY = document.querySelector('.pageY');
const clientX = document.querySelector('.clientX');
const clientY = document.querySelector('.clientY');
const mouseImg = document.querySelector('.mouseImg');

const bodyElement = document.body;

function showPosition(e){
    screenX.textContent = e.screenX;
    screenY.textContent = e.screenY;
    pageX.textContent = e.pageX;
    pageY.textContent = e.pageY;
    clientX.textContent = e.clientX;
    clientY.textContent = e.clientY; =e.clientX+'px'; //用 right 滑鼠&圖案取代鼠標的滑鼠會反方向。 =e.clientY+'px';