1.html 678 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <div id="editor">
  2. <h2>Hello world!</h2>
  3. <p>This is an editor instance.</p>
  4. <p>This is an editor instance.</p>
  5. <p>This is an editor instance.</p>
  6. <p>This is an editor instance.</p>
  7. <p>This is an editor instance.</p>
  8. <p>This is an editor instance.</p>
  9. </div>
  10. <div id="fixed">The toolbar should stick to me instead of the viewport.</div>
  11. <style>
  12. body {
  13. height: 10000px;
  14. }
  15. .ck-editor {
  16. margin-top: 200px;
  17. margin-left: 100px;
  18. margin-bottom: 200px;
  19. width: 450px;
  20. }
  21. #fixed {
  22. width: 100%;
  23. height: 100px;
  24. position: fixed;
  25. top: 0;
  26. z-index: 9999;
  27. background: green;
  28. opacity: .8;
  29. color: #fff;
  30. box-sizing: border-box;
  31. padding: 40px;
  32. }
  33. </style>