Einzelnen Beitrag anzeigen

Der schöne Günther

Registriert seit: 6. Mär 2013
6.110 Beiträge
 
Delphi 10 Seattle Enterprise
 
#4

AW: HTML / CSS: Was sind 100% Höhe?

  Alt 24. Sep 2018, 21:49
Danke für die Antworten.

Danke für den Tipp mit VS, das wird mir noch öfter helfen 😊

Danke auch für den Tipp mit den Spezifikationen. Ich habe noch etwas gesucht und hier hatte jemand exakt die gleiche Frage und es unterhaltsam aufbereitet:
https://www.kirupa.com/html5/make_bo...ser_height.htm

Des Rätsels Lösung: Dem <html>-Knoten noch eine Höhe von 100% geben. Da wäre ich nie drauf gekommen.
Zitat:
See, our body element's height is set to be 100% of the height of the containing block. The containing block is the html element, and we never specified a height on it. Because there isn’t any content on the page, the height of the html element...wait for it...is also 0. The solution to our problem then would be to specify a height value of 100% on the html element as well:
Das sieht dann tatsächlich so aus:
Code:
<!DOCTYPE html>
<html style="height: 100%;">
<head>
   <style>
      body {
         height: 100%;
         padding:0px;
         margin: 0px;
      }
   </style>
</head>
<body>
   <div style="height: 100%; background-color: red;">
      Hallo Welt
   </div>
</body>
</html>
  Mit Zitat antworten Zitat