Prikazi cijelu temu 20.04.2018 10:45
Avko Van mreze
Administrator
Registrovan od:28.05.2014
Lokacija:zagreb


Predmet:CSS problemi
Imam problem kada je css file, kada stavim u index page radi, a kao posebni file onda ne radi. Kako to rijesiti?

ovo radi:
index.html

PreuzmiIzvorni kôd (HTML):
  1. <!DOCTYPE html>
  2. <head lang="hr">
  3.     <meta charset="UTF-8">
  4.     <title>POCETNA STRANICA</title>
  5.  
  6. html, body {
  7.   height: 100%;
  8.   margin: 0;
  9. }
  10. .content {
  11.   min-height: 100%;
  12. }
  13. .content-inside {
  14.   padding: 20px;
  15.   padding-bottom: 50px;
  16. }
  17. .footer {
  18.   height: 50px;
  19.   margin-top: -50px;
  20. }
  21.  
  22. body {
  23.   font: 16px Sans-Serif;
  24. }
  25. h1 {
  26.   margin: 0 0 20px 0;
  27. }
  28. p {
  29.   margin: 20px 0 0 0;
  30. }
  31. footer {
  32.   background: #42A5F5;
  33.   color: white;
  34.   line-height: 50px;
  35.   padding: 0 20px;
  36. }
  37. </head>
  38. <div class="content">
  39.   <h1>MENI</h1>
  40.   <p>NEKI TEXT</p>
  41. </div>
  42.  
  43. <footer class="footer">
  44.   FOOTER
  45. </footer>
  46. </body>
  47. </html>

ovo ne radi:
index.html

PreuzmiIzvorni kôd (HTML):
  1. <!DOCTYPE html>
  2. <head lang="hr">
  3.     <meta charset="UTF-8">
  4.     <title>POCETNA STRANICA</title>
  5.     <link rel="stylesheet" href="style.css">
  6. </head>
  7. <div class="content">
  8.   <h1>MENI</h1>
  9.   <p>NEKI TEXT</p>
  10. </div>
  11.  
  12. <footer class="footer">
  13.   FOOTER
  14. </footer>
  15. </body>
  16. </html>

style.css

PreuzmiIzvorni kôd (CSS):
  1. html, body {
  2.   height: 100%;
  3.   margin: 0;
  4. }
  5. .content {
  6.   min-height: 100%;
  7. }
  8. .content-inside {
  9.   padding: 20px;
  10.   padding-bottom: 50px;
  11. }
  12. .footer {
  13.   height: 50px;
  14.   margin-top: -50px;
  15. }
  16.  
  17. body {
  18.   font: 16px Sans-Serif;
  19. }
  20. h1 {
  21.   margin: 0 0 20px 0;
  22. }
  23. p {
  24.   margin: 20px 0 0 0;
  25. }
  26. footer {
  27.   background: #42A5F5;
  28.   color: white;
  29.   line-height: 50px;
  30.   padding: 0 20px;
  31. }

zivot je moja domovina.