CSS font-size funktioniert nicht für h1 nur in einem block

Ist, habe ich mich um eine Lösung für dieses, aber es muss etwas sein, was ein bisschen seltsam isnce bith die CSS-und html überprüfen mit dem w3c-checker.

CSS-Snippet:

body{
    background-color: #ffffff;
    color:#000000;
    text-align: left;
  height:100%;
}

h1{
  font-size: 250%;
  font-weight: normal;
  text-align: center;
}
h2{
  font-size:150%;
}
h1{
  font-size:120%;
}
#MainHeader{
  background-color:#efefef;
  background: url("http://www.wou.edu/images/spotlight/wounews.png") no-repeat;
  padding:15px 0px 15px 0px;
}
#MainContent{
  background: url("http://stuff.bodestone.net/jr/construction.gif");
  padding: 8px 8px 8px 8px;
  clear:both;
  background-color:#ff00ff;
  overflow:auto;
  height: auto;
}
#MenuBar{
  background-color:#dfdfff;
  float:left;
    padding: 15px 0px 15px 0px;
    overflow: auto;
  height: 100%;
}
#PageContent{
  float:left;
  background-color:#dedebe;
  overflow: auto;
    padding: 15px 15px 15px 15px;
  overflow: auto;
}

Und HTML:

  <body>
    <div id="MainHeader">
      <h1>A random template site to work some stuff out</h1>
    </div>
    <div id="MainContent" class="clearfix">
      <div id="MenuBar">
        <a href="index.html" class="here">Page 1</a><br>
        <a href="page2.html">Page 2</a><br>
        <a href="page3.html">Page 3</a><br>
      </div>
      <div id="PageContent">
        <h2>This is page 1</h2>
        <p>lar</p>
      </div>
    </div>
    <div id="Footer" class="clearfix">
      <span style="float:left">And here we have a footer.</span><span style="float:right">Style info for left and right defined separately in the html.</span>
    </div>
  </body>

Wenn ich die schriftart ändern-Gewicht h1 es änderungen. Wenn ich die schriftart ändern, die Größe tut es nicht.
Ändern kann ich Gewicht und Größe des h2 in den PageContent DIV.

Als eine Nebenbemerkung, die ich verwendet habe, * bevor für Globale Definitionen am Anfang des Stylesheets. Ist das die gleiche wie root?

  • Das * ist nicht die Wurzel, es ist eine wildcard-passt zu jedem element. Verwenden Sie Körper-oder html als root.
InformationsquelleAutor Bodestone | 2011-03-06
Schreibe einen Kommentar