Forums

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

Home Forums CSS CSS–Background Color

  • This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #246412
    TV
    Participant

    I can’t quite figure out why the background color is not changing. I’m practicing Internal CSS.

    <!DOCTYPE html>
      <html>
        <head>
          <title>InternalCSS</title>
          <style type="text/css">
           body {
             font-family: bell gothic;
             background-color: rgb (0,204,255);}
           h1 {
               color: rgb (255,153,0);}
        </style>
      </head>
      <body>
        <h1>Potatoes</h1>
    
    There are dozens of different potato
           varieties. They are usually described as
           early, second early and main crop.
    
    </body>
      </html>
    
    #246413
    Paulie_D
    Member

    It’s because you have a space between rgb and (

    http://codepen.io/Paulie-D/pen/BLxmxg

    #246415
    TV
    Participant

    Thank you so much! In some ways I’m beginning to understand CSS and another way I find it frustrating.

    #246421
    I.m.learning
    Participant

    @Paulie_D
    I’ve seen you are quite knowledgeable in coding; is there any difference between using the style tag with/without the “type”?

    #246422
    Paulie_D
    Member

    I don’t believe so. Browsers have gotten quite clever at realising when something is style tag…after all, what else would you put in there?

    In fact, after checking, it is optional. Here’s what MDN says

    This attribute defines the styling language as a MIME type (charset should not be specified). This attribute is optional and default to text/css if it’s missing.

    #246423
    I.m.learning
    Participant

    Excellent!

Viewing 6 posts - 1 through 6 (of 6 total)
  • The forum ‘CSS’ is closed to new topics and replies.