code_junkie

How to insert a text-like element into document using javascript and CSS?

Nov 10th, 2011
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. span#yourSpan {
  2. /* defaults */
  3. position: static;
  4. display: inline;
  5. margin: 0;
  6. padding: 0;
  7. background: transparent;
  8. border: none;
  9.  
  10. /* inherit from parent node */
  11. font: inherit;
  12. color: inherit;
  13. text-decoration: inherit;
  14. line-height: inherit;
  15. letter-spacing: inherit;
  16. text-transform: inherit;
  17. white-space: inherit;
  18. word-spacing: inherit;
  19. }
  20.  
  21. <span class="hello-node">hello</span>
  22.  
  23. span.hello-node {
  24. /* defaults */
  25. position: static !important;
  26. display: inline !important;
  27. ...
  28. }
  29.  
  30. <p style="display: inline">Hello <p id="myIdValue" style="display: inline">new</p> World</p>
  31.  
  32. span {
  33. display: block;
  34. margin: 10px;
  35. padding: 10px;
  36. }
  37.  
  38. <span style="display: inline; margin: 0; padding: 0;">New Span</span>
Add Comment
Please, Sign In to add comment