Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Very New to CSS (basic question about background color)

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #276337
    mason64
    Participant

    Hi

    Just learning started a few hours ago but i have got stuck

    If i have my style sheet with this code

    body {

    background-color: #D7CEC7;
    }
    

    Shouldnt that make all my pages have that colour the background?

    If i had the code to the html page itself it works but not if i add it to the style sheet. if i had font colour and so on to the style shee that works fine.

    Thanks in advance.

    #276345
    Paulie_D
    Member

    It’s hard to tell but the code


    body { background-color:#D7CEC7; }

    certainly should work but it will only extend to the height of the content unless there is something else going on.

    The body element is not the height of the viewport by default.

    If it’s not working in the stylesheet then either you have a path error (the stylesheet isn’t linked right) or a syntax error and you should check your code.

    #276346
    mason64
    Participant

    i will look more in to it thanks
    dave

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.