Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!
  • Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • You can also use markdown to share your code. When using markdown your code will be automatically converted to BBCode. For help with markdown check out the markdown guide.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.


    To learn more about how to use our BBCode feature, please click here.

    Thank you, Code Forum.

Problems with footer styling

Edrol97

Bronze Coder
Hi all,

Wondering why my footer is displaying as below with the current css and html. Lots of white space that shouldn't be there. If anyone can spot the reason, it would be much appreciated.

HTML:
 <div class="footer">
        <a href="https://www.facebook.com/house.of.lord.illustration1/" target="_blank"><img src="img/background/Facebook Logo.png" class="fa fa-facebook"></a>
        <a href="https://twitter.com/eliotlord1" target="_blank"><img src="img/background/Twitter%20Logo.png" class="fa fa-twitter"></a>
        <a href="https://www.instagram.com/house_of_lord_illustration/?hl=en" target="blank"><img src="img/background/Instagram logo.png" class="fa fa-instagram"></a>
    
     <a href="Home.html"><div class="title_text3">&#169 Eliot Lord 2024</div></a>
     <br>
     <div class="column"><a href="Home.html"><p>Phone Home</p></a></div>
     <div class="column"><a href="about_me.html"><p>About Me</p></a></div>
     <div class="column"><a href="Art.html"><p>The Show</p></a></div>
     <div class="column"><a href="Bad_Times.html"><p>Bad Times are Now</p></a></div>
     <div class="column"><a href="The_Pun.html"><p>The Pun</p></a></div>
     <div class="column"><a href="https://procartoonists.org/profile/eliotlord/" target="_blank"><p>Trust Me, I'm a Professional</p></a></div>
     <div class="column"><a href="Mail.html"><p>The Fail</p></a></div>
     <div class="column"><a href="mailto:[email protected]"><p>Hit Me Up</p></a></div>   
  
       </div>

CSS:
.footer {
  background-color: lightgrey;
  display: block;
  grid-gap: 1rem;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  padding: 1rem;
}

.column {
  background-color: lightgrey;
  padding: 0;
  float: left;
  width: 300px;
}
 

Attachments

  • Screenshot 2024-06-19 at 20.31.43.png
    Screenshot 2024-06-19 at 20.31.43.png
    185.9 KB · Views: 3
Also, you use paragraph inside of link.
CSS:
     <div class="column"><a href="Home.html"><p>Phone Home</p></a></div>

Your code does not reveal the style of paragraph, but often it has values similar what we see in your attachment. There is no any need to use paragraph inside link in your case. Paragraph is handy, when you have more stuff inside same div. In this case, your div only consists this one link, there is no need to use it.

Change it as
Code:
     <div class="column"><a href="Home.html">Phone Home</a></div>

Play with these two options, you may get results you want.
 
Also, you use paragraph inside of link.
CSS:
     <div class="column"><a href="Home.html"><p>Phone Home</p></a></div>

Your code does not reveal the style of paragraph, but often it has values similar what we see in your attachment. There is no any need to use paragraph inside link in your case. Paragraph is handy, when you have more stuff inside same div. In this case, your div only consists this one link, there is no need to use it.

Change it as
Code:
     <div class="column"><a href="Home.html">Phone Home</a></div>

Play with these two options, you may get results you want.
I tried that and it didn't give the outcome I wanted. The lines were too close together. I tried what you suggested and the white spaces were still there. The background should be all grey.
 
More info required. Atleast i cant pinpoint the problem with provided data. Though here is many badass php programmers who might.
Perhaps doing it the opposite way round could be easier. I've changed the body colour to my desired footer colour and have changed the background colour of the main div containing the text, but still having an issue with the header colour.
 
This really isn't enough info. Do you have a link to look at?

I will recommend that the <p> be outside the <a> and the columns can be handled differently, but that's not really the issue I suspect.
 

New Threads

Latest posts

Buy us a coffee!

Back
Top Bottom