marker-string.html 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <!DOCTYPE HTML>
  2. <!--
  3. Any copyright is dedicated to the Public Domain.
  4. http://creativecommons.org/licenses/publicdomain/
  5. Test: text-overflow:<string>
  6. -->
  7. <html><head>
  8. <title>text-overflow: text-overflow:&lt;string&gt;</title>
  9. <style type="text/css">
  10. @font-face {
  11. font-family: DejaVuSansMono;
  12. src: url(../fonts/DejaVuSansMono.woff);
  13. }
  14. html,body {
  15. color:black; background-color:white; font-size:16px; padding:0; margin:0; font-family:DejaVuSansMono;
  16. }
  17. .test {
  18. overflow:hidden;
  19. width:20ch;
  20. height:3em;
  21. white-space:nowrap;
  22. margin-left:2em;
  23. position:relative;
  24. }
  25. span {
  26. margin: 0 -0.5ch;
  27. }
  28. s {
  29. margin: 0 -0.5ch;
  30. padding: 0 11ch;
  31. }
  32. .rlo {
  33. unicode-bidi: bidi-override; direction:rtl;
  34. }
  35. .lro {
  36. unicode-bidi: bidi-override;
  37. }
  38. .rtl {
  39. direction:rtl;
  40. }
  41. .ltr {
  42. direction:ltr;
  43. }
  44. .t1 { text-overflow:"" ""; }
  45. .t2 { text-overflow:"Hello World" "Hello World"; }
  46. .t3 { text-overflow:"X" "X"; }
  47. </style>
  48. </head><body>
  49. <!-- Empty marker clips text -->
  50. <div class="test t1"><span>xx</span></div>
  51. <div class="test rtl t1"><span>xx</span></div>
  52. <!-- big marker clips all text -->
  53. <div class="test t2"><span>xx</span></div>
  54. <div class="test rtl t2"><span>xx</span></div>
  55. <!-- start marker that doesn't fit -->
  56. <div class="test t2" style="width:3ch"><span>xx</span></div>
  57. <div class="test rtl t2" style="width:3ch"><span>xx</span></div>
  58. <!-- start + end marker, nothing to align to -->
  59. <div class="test t3"><s></s></div>
  60. <div class="test rtl t3"><s></s></div>
  61. </body>
  62. </html>