title: Displaying an alert box of error message using CSS
body: <p>Am creating a login form on a website whereby am having trouble creating an alert box at the top of the form that should display error messages after server-side validation and sanitization of the user input.The problem is that when the page loads, it displays the alert-box, while I want it to display only when displaying error messages. Please assist?</p>
  
  <p><strong>HTML PART</strong></p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
    &lt;title&gt;Login Form&lt;/title&gt;
    &lt;link href="style.css" rel="stylesheet" type="text/css"&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
  &lt;div class="form"&gt;
  
  &lt;span class="info"&gt;
  &lt;?php
          echo
              $fNameErr;
              $lNameErr;
              $emailErr;
  
  ?&gt;
  &lt;/span&gt;
  
  
  &lt;br&gt;
  
      &lt;ul class="tab-group"&gt;
          &lt;li class="tab active"&gt;&lt;a href="#signup"&gt;Sign Up&lt;/a&gt;&lt;/li&gt;
          &lt;li class="tab"&gt;&lt;a href="login.php"&gt;Log In&lt;/a&gt;&lt;/li&gt;
      &lt;/ul&gt;
  
  &lt;div class="tab-content"&gt;
  &lt;h1&gt;Sign Up for Free&lt;/h1&gt;
  
  
                  &lt;form action="signup.php" method="post" autocomplete="off"&gt;
  
                      &lt;div class="top-row"&gt;
                          &lt;div class="field-wrap"&gt;
                              &lt;label&gt;
                                  &lt;span class="req"&gt;&lt;/span&gt;
                              &lt;/label&gt;
                              &lt;input placeholder="Firstname*" type="text" value="&lt;?php echo $firstname;?&gt;" required autocomplete="off" name='firstname' /&gt;
                          &lt;/div&gt;
  
                          &lt;div class="field-wrap"&gt;
                              &lt;label&gt;
                                  &lt;span class="req"&gt;&lt;/span&gt;
                              &lt;/label&gt;
                              &lt;input placeholder="LastName*" type="text" value="&lt;?php echo $lastname;?&gt;" required autocomplete="off" name='lastname' /&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
  
                      &lt;div class="field-wrap"&gt;
                          &lt;label&gt;
                              &lt;span class="req"&gt;&lt;/span&gt;
                          &lt;/label&gt;
                          &lt;input placeholder="Email Address*" type="email" value="&lt;?php echo $email;?&gt;" required autocomplete="off" name='email' /&gt;
                      &lt;/div&gt;
  
                      &lt;div class="field-wrap"&gt;
                          &lt;label&gt;
                              &lt;span class="req"&gt;&lt;/span&gt;
                          &lt;/label&gt;
                          &lt;input placeholder="Set A Password*" type="password"required autocomplete="off" name='password'/&gt;
                      &lt;/div&gt;
  
                      &lt;button type="submit" class="button button-block" name="register"&gt;Register&lt;/button&gt;
  
                  &lt;/form&gt;
  
  
  
  &lt;/div&gt; &lt;!-- /form --&gt;
   &lt;/div&gt; 
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>style.css page</strong></p>
  
  <pre><code>.info {
      color: pink;
      display: block;
      text-align: center;
      padding: 5px;
      margin-top: -20px;
      margin-bottom: 15px;
      border: 1px solid red;
      background: #66131c;
  }
  </code></pre>