Home > OS >  Footer background-color not showing up
Footer background-color not showing up

Time:11-05

I used background-color but the color didn't show up

i tried typing

<footer style="background-color: hsl(0 18% 81%)">

and i was expecting it to change the color of the background but it didn't. thank you to anyone who would like to help me

CodePudding user response:

Try to close footer and put somthing inside:

    <footer style="background-color: hsl(0, 18%, 81%)">
      <h1>footer</h1>
    </footer>

CodePudding user response:

The issue you're facing might be due to several reasons. Here are some steps to troubleshoot and fix the problem:

Correct Syntax: Ensure that the HSL value has the correct syntax. The correct syntax for HSL is hsl(hue, saturation%, lightness%). You missed the commas in your code. Try:

<footer style="background-color: hsl(0, 18%, 81%)">

Content in the Footer: If your footer is empty or its content is not causing it to have any height, you won't see the background color. Ensure that there's content inside the footer or set a specific height to it:

 <footer style="background-color: hsl(0, 18%, 81%); height: 50px;">

Overriding Styles: There might be other CSS styles (either inline, internal, or external) that are overriding the background color you've set. Check if there are any other styles applied to the footer that might be conflicting.

  • Related