footer-immer-unten-ohne-flex-und-javascript.php


Quell Code


<!DOCTYPE html>
<html lang="de">
<head>
<title>footer</title>
<style>

*{
 margin:0;
 padding:0;
 list-style:none;
}
 
html,body{
 height:100%;
 background:#123456;
}
 
 
body:before {
 content:"";
 height:calc(100% - 12px);
 margin-bottom:-100px;
 float:left ;
 display:inline-block; 
}

header{
 background:blue;
 height:100px;
  border:2px solid white;
}  

main{
 overflow:hidden;
 background:blue;
 height:30%;
 border:2px solid white;
}
 
footer {
 clear:both;
  height:100px;
 background:blue;
 border:2px solid white;
} 

</style>
</head>

<body>
<header><h1>Footer immer unten mit der Pseudoklasse :before</h1></header>
<main> <h2>Platz für weitere Spalten ( Menü und Inhalt )</h2></main>
<footer></h4>Footer</h4></footer> 
</body>

</html>
  1. <!DOCTYPE html>
  2. <html lang="de">
  3. <head>
  4. <title>footer</title>
  5. <style>
  6. *{
  7. margin:0;
  8. padding:0;
  9. list-style:none;
  10. }
  11. html,body{
  12. height:100%;
  13. background:#123456;
  14. }
  15. body:before {
  16. content:"";
  17. height:calc(100% - 12px);
  18. margin-bottom:-100px;
  19. float:left ;
  20. display:inline-block;
  21. }
  22. header{
  23. background:blue;
  24. height:100px;
  25. border:2px solid white;
  26. }
  27. main{
  28. overflow:hidden;
  29. background:blue;
  30. height:30%;
  31. border:2px solid white;
  32. }
  33. footer {
  34. clear:both;
  35. height:100px;
  36. background:blue;
  37. border:2px solid white;
  38. }
  39. </style>
  40. </head>
  41. <body>
  42. <header><h1>Footer immer unten mit der Pseudoklasse :before</h1></header>
  43. <main> <h2>Platz für weitere Spalten ( Menü und Inhalt )</h2></main>
  44. <footer></h4>Footer</h4></footer>
  45. </body>
  46. </html>
<!DOCTYPE html>
<html lang="de">
<head>
<title>footer</title>
<style>

*{
 margin:0;
 padding:0;
 list-style:none;
}
 
html,body{
 height:100%;
 background:#123456;
}
 
 
body:before {
 content:"";
 height:calc(100% - 12px);
 margin-bottom:-100px;
 float:left ;
 display:inline-block; 
}

header{
 background:blue;
 height:100px;
  border:2px solid white;
}  

main{
 overflow:hidden;
 background:blue;
 height:30%;
 border:2px solid white;
}
 
footer {
 clear:both;
  height:100px;
 background:blue;
 border:2px solid white;
} 

</style>
</head>

<body>
<header><h1>Footer immer unten mit der Pseudoklasse :before</h1></header>
<main> <h2>Platz für weitere Spalten ( Menü und Inhalt )</h2></main>
<footer></h4>Footer</h4></footer> 
</body>

</html>

vConsole
17:35:50
Uncaught TypeError: Cannot read properties of null (reading 'style')
/Kurze-Scripte-und-Codeschnipsel/index.php?name=footer-immer-unten-ohne-flex-und-javascript.php:2751:53
17:35:52
500
17:35:50
WeChatLib: 0 (xxxx.xx.xx)
17:35:52
System: Unknown
17:35:52
Protocol: HTTPS
17:35:52
UA: Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
17:35:52
navigationStart: 1744047350211
17:35:52
navigation: 3ms
17:35:52
dns: 113ms
17:35:52
tcp (ssl): 224ms (115ms)
17:35:52
request: 219ms
17:35:52
response: 58ms
17:35:52
domComplete (domLoaded): 1620ms (1493ms)
17:35:52
loadEvent: 20ms
17:35:52
total (DOM): 2204ms (2183ms)