html – Bold和Italics在Firefox或Chrome中不起作用

前端之家收集整理的这篇文章主要介绍了html – Bold和Italics在Firefox或Chrome中不起作用前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
粗体< b>< / b>和斜体< i>< / i>标签在iPhone和Internet Explorer上正确呈现,但Firefox或Chrome中没有格式.

这是.css文件.我也尝试添加i {font-style:italic;分别在重置和样式中.

  1. Color.css:
  2.  
  3. body {
  4. color: #fff;
  5. background-image: url(../img/background-red.png);
  6. }
  7.  
  8. Reset.css:
  9.  
  10. /* http://meyerweb.com/eric/tools/css/reset/
  11. v2.0 | 20110126
  12. License: none (public domain)
  13. */
  14.  
  15. html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,input,textarea,button
  16. table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video {
  17. margin: 0;
  18. padding: 0;
  19. border: 0;
  20. font-size: 100%;
  21. font: inherit;
  22. vertical-align: baseline;
  23. }
  24.  
  25. /* HTML5 display-role reset for older browsers */
  26. article,section {
  27. display: block;
  28. }
  29. body {
  30. line-height: 1;
  31. }
  32. ol,dl {
  33. list-style: none;
  34. }
  35. blockquote,q {
  36. quotes: none;
  37. }
  38. blockquote:before,blockquote:after,q:before,q:after {
  39. content: '';
  40. content: none;
  41. }
  42. table {
  43. border-collapse: collapse;
  44. border-spacing: 0;
  45. }
  46.  
  47.  
  48. Style.css:
  49.  
  50. html,body {
  51. height: 100%;
  52. }
  53.  
  54. body {
  55. margin: 0;
  56. overflow: hidden;
  57.  
  58. font: normal 18px/1.4 'Open Sans',Arial,Helvetica,sans-serif;
  59.  
  60. background-position: left top;
  61. background-repeat: no-repeat;
  62. }
  63.  
  64. .panel {
  65. position: absolute;
  66. z-index: 0;
  67. background: #fff;
  68.  
  69. -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
  70. filter: alpha(opacity=0);
  71. opacity: 0;
  72.  
  73. -moz-Box-shadow: 0 0 10px #fff;
  74. -webkit-Box-shadow: 0 0 10px #fff;
  75. Box-shadow: 0 0 10px #fff;
  76. }
  77.  
  78.  
  79. .content {
  80. max-width: 45%;
  81. margin: 100px;
  82.  
  83. float: left;
  84.  
  85. position: relative;
  86. z-index: 1;
  87. }
  88.  
  89. h1 {
  90. font-size: 72px;
  91. line-height: 56px;
  92. font-weight: 300;
  93. }
  94.  
  95. h2 {
  96. margin: 15px 0 50px;
  97.  
  98. font-size: 30px;
  99. line-height: 30px;
  100. font-weight: 300;
  101. }

这是HTML,我尝试使用< strong> asdf< / strong>看它是否会使文字变粗,但事实并非如此.

  1. <div class="content">
  2. <h1>adssda</h1>
  3. <h2>dasdasdsa</h2>
  4.  
  5. <p><i><strong>sadsad</strong>asdsad</i></p><br>
  6. sadasddsa<br><br>
  7. <strong>asdasd</strong><br><br>
  8. <p><strong>asdasd</strong></p><br>
  9. </div>

为什么粗体文本看起来与普通文本相同?

解决方法

字体:在主复位块中继承(复位头下的第一个)会导致页面上的所有字体被重置.的确,not even fixing the invalid html to be valid fixes this,你的css记在心里.

评论此房产fixes your text.

猜你在找的HTML相关文章