Footer Just Disappeared (PHP & CSS)

I was editing the coding but I did not touch the part of footer and this just happened to me :frowning:

CSS

* {
  box-sizing: border-box;
}

body {
  font-family: Arial, Helvetica, sans-serif;
}

/* Style the header */
header {
  background-color: #666;
  padding: 30px;
  text-align: center;
  font-size: 35px;
  color: white;
}

/* Create two columns/boxes that floats next to each other */
nav {
  float: left;
  width: 30%;
  height: 300px; /* only for demonstration, should be removed */
  background: #ccc;
  padding: 20px;
}

/* Style the list inside the menu */
nav ul {
  list-style-type: none;
  padding: 0;
}

article {
  float: left;
  padding: 20px;
  width: 70%;
  background-color: #f1f1f1;
  height: 300px; /* only for demonstration, should be removed */
}

/* Clear floats after the columns */
section:after {
  content: "";
  display: table;
  clear: both;
}

/* Style the footer */
footer {
  background-color: #777;
  padding: 10px;
  text-align: center;
  color: white;
}

/* Responsive layout - makes the two columns/boxes stack on top of each other instead of next to each other, on small screens */
@media (max-width: 600px) {
  nav, article {
    width: 100%;
    height: auto;
  }
}

PHP

<!DOCTYPE html>
	<title>Laman Utama Saya</title>
	<link rel="stylesheet" type="text/css" href="css/style.css">
<section>
	<article>
		<center><h1>Selamat datang ke Laman Pengurusan Acara Rumah Sukan Beta</h1></center>
		</td></tr>	
	</article>
</section>
<footer>
	Hak Cipta Terpelihara
</footer>

Welcome to the forums, @iamcubex.

When you post code on the forums, you need to format it so it will display correctly. (We’ve edited your post above for you.)

You can highlight your code, then use the </> button in the editor window, or you can place three backticks ``` (top left key on US/UK keyboards) on a line above your code, and three on a line below your code. I find this approach easier, but unfortunately some European and other keyboards don’t have that character.

1 Like

oh okay, thank you for editing my post :smiley:

1 Like

Hi @iamcubex, where are your <head> and <body> tags?

Also (small point) but I don’t see any PHP in your HTML.

3 Likes

I’m gonna go ahead and guess you opened the developer console in your browser, which shrank your viewport to less than 600px.

1 Like

oh ya, I missed the tags.I added those tags into my coding and it worked :smiley: thank you very much. For the PHP I don’t know why because my teacher told me to change HTML from sublime text 3 to PHP.
Once again thank you very much for all your help. :smiley:

1 Like

I don’t understand what you were talking about. But thanks for helping me :smiley: and the problem was solved.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.