Guest User

Untitled

a guest
Jun 19th, 2013
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.47 KB | None | 0 0
  1. <h1><span>Example Heading</span></h1>
  2.  
  3. h1 {
  4. background-image: url(line.png);
  5. }
  6. h1 span {
  7. background: #fff;
  8. }
  9.  
  10. <h1>
  11. <span>Test</span>
  12. <hr>
  13. <div class="end"></div>
  14. </h1>
  15.  
  16. h1 span{ float :left; margin-right: 1ex; }
  17. h1 hr {
  18. border: none;
  19. height: 1px;
  20. background-color: red;
  21. position: relative;
  22. top:0.5em;
  23. }
  24. h1 div.end { clear:both; }
  25.  
  26. <div class="title">
  27. <div class="title1">TITLE</div>
  28. </div>
  29.  
  30. .title {
  31. height: 1px;
  32. margin-bottom: 20px;
  33. margin-top: 10px;
  34. border-bottom: 1px solid #bfbfbf;
  35. }
  36. .title .title1 {
  37. width: 125px;
  38. margin: 0 auto;
  39. font-family: Arial, sans-serif;
  40. font-size: 22px;
  41. color: #4c4c4c;
  42. background: #fff;
  43. text-align: center;
  44. position: relative;
  45. top: -12px
  46. }
  47.  
  48. <div class="heading-wrapper">
  49. <h1>Example Heading</h1>
  50. <img src="line.png" width="193" height="6" alt="" />
  51. </div>
  52.  
  53. h1{font-size:16px}
  54. h2{font-size:14px}
  55. h3{font-size:12px}
  56. h1,h2,h3{margin:0;padding:0;float:left}
  57. .heading-wrapper{width:300px;overflow-x:hidden}
  58. .heading-wrapper img{
  59. float:right;padding-top:9px;
  60. /*ie9: position:relative;top:-9px */
  61. }
  62.  
  63. setHeadingLineWidth('h1');
  64. setHeadingLineWidth('h2');
  65. setHeadingLineWidth('h3');
  66.  
  67. function setHeadingLineWidth(selector){
  68. var hWidth;
  69. var lineWidth;
  70. var wrWidth = $('.heading-wrapper').width();
  71.  
  72. hWidth = $(selector,'.heading-wrapper').width();
  73. lineWidth = wrWidth - hWidth;
  74. $(selector).siblings('img').width(lineWidth);
  75. }
Advertisement
Add Comment
Please, Sign In to add comment