11 Replies Latest reply on Nov 23, 2008 2:35 PM by Newsgroup_User

    Background color code is not working. Please help

      I am trying to add a background color to a page.

      But the background color is not showing.

      What I am doing is adding, using just as an example pink:
      bgcolor: pink;
      to the style section.

      Here is a simplified version of the code. It just uses the letter "a repeated for where there is much more text:

      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <html xmlns=" http://www.w3.org/1999/xhtml">
      <head>
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
      <title>Untitled Document</title>
      <style type="text/css">
      p.MsoNormal {
      margin:0cm;
      margin-left: 30px;
      margin-bottom:.0001pt;
      bgcolor: pink;
      font-size:12.0pt;
      font-family:"Times New Roman";
      }
      </style>
      </head>

      <body>
      <p class="MsoNormal" style="text-autospace:none;"><span style="font-family:Geneva; color:black; "> </span></p>
      <p class="MsoNormal" style="line-height:14.0pt;text-autospace:none;"><span style="font-family:'Arial Black'; font-size:14.0pt; ">aaaaaaaa aaaaaaaaa aaaaa aaaaaa</span></p>

      </body>
      </html>

      What am I doing wrong?
        • 1. Re: Background color code is not working. Please help
          Level 7
          body {background-color: pink}


          "pppp145pp" <webforumsuser@macromedia.com> wrote in message
          news:gg7vf7$nba$1@forums.macromedia.com...
          >I am trying to add a background color to a page.
          >
          > But the background color is not showing.
          >
          > What I am doing is adding, using just as an example pink:
          > bgcolor: pink;
          > to the style section.
          >
          > Here is a simplified version of the code. It just uses the letter "a
          > repeated
          > for where there is much more text:
          >
          > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          > " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
          > <html xmlns=" http://www.w3.org/1999/xhtml">
          > <head>
          > <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
          > <title>Untitled Document</title>
          > <style type="text/css">
          > p.MsoNormal {
          > margin:0cm;
          > margin-left: 30px;
          > margin-bottom:.0001pt;
          > bgcolor: pink;
          > font-size:12.0pt;
          > font-family:"Times New Roman";
          > }
          > </style>
          > </head>
          >
          > <body>
          > <p class="MsoNormal" style="text-autospace:none;"><span
          > style="font-family:Geneva; color:black; "> </span></p>
          > <p class="MsoNormal" style="line-height:14.0pt;text-autospace:none;"><span
          > style="font-family:'Arial Black'; font-size:14.0pt; ">aaaaaaaa aaaaaaaaa
          > aaaaa
          > aaaaaa</span></p>
          >
          > </body>
          > </html>
          >
          > What am I doing wrong?
          >


          1 person found this helpful
          • 2. Background color code is not working. Please help
            Thanks Ken
            • 3. Re: Background color code is not working. Please help
              Level 7
              >> What am I doing wrong?

              1. Using improper CSS syntax as Ken pointed out.
              2. Using code from MS Word (p.MsoNormal).
              3. Using physical units of measure in your CSS for an on-screen document
              (pt, cm)
              4. Using an invalid CSS property (text-autospace)

              --

              Walt


              "pppp145pp" <webforumsuser@macromedia.com> wrote in message
              news:gg7vf7$nba$1@forums.macromedia.com...
              >I am trying to add a background color to a page.
              >
              > But the background color is not showing.
              >
              > What I am doing is adding, using just as an example pink:
              > bgcolor: pink;
              > to the style section.
              >
              > Here is a simplified version of the code. It just uses the letter "a
              > repeated
              > for where there is much more text:
              >
              > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
              > " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
              > <html xmlns=" http://www.w3.org/1999/xhtml">
              > <head>
              > <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
              > <title>Untitled Document</title>
              > <style type="text/css">
              > p.MsoNormal {
              > margin:0cm;
              > margin-left: 30px;
              > margin-bottom:.0001pt;
              > bgcolor: pink;
              > font-size:12.0pt;
              > font-family:"Times New Roman";
              > }
              > </style>
              > </head>
              >
              > <body>
              > <p class="MsoNormal" style="text-autospace:none;"><span
              > style="font-family:Geneva; color:black; "> </span></p>
              > <p class="MsoNormal" style="line-height:14.0pt;text-autospace:none;"><span
              > style="font-family:'Arial Black'; font-size:14.0pt; ">aaaaaaaa aaaaaaaaa
              > aaaaa
              > aaaaaa</span></p>
              >
              > </body>
              > </html>
              >
              > What am I doing wrong?
              >


              • 4. Re: Background color code is not working. Please help
                Level 7
                CSS syntax is made up of a selector, a property and a value.
                Your posted style rule used the selector p and a series of properties and a
                values which are designed to only affect the display of text within
                paragraph tags, and would have no effect on the page's background color.

                The code I provided was a new rule for the body selector and would have
                been inserted in your stylesheet in addition to your corrected rule for the
                p tags.

                Go here to learn CSS:
                http://www.w3schools.com/css/default.asp









                "pppp145pp" <webforumsuser@macromedia.com> wrote in message
                news:gg80jo$ohi$1@forums.macromedia.com...
                > Hi Ken,
                >
                > Did you mean to replace
                > bgcolor: pink;
                > with
                > body {background-color: pink};
                >
                > I doing that, but it is not working.


                1 person found this helpful
                • 5. Re: Background color code is not working. Please help
                  Thanks Ken and thanks Walt.

                  Even though I had done some reading on HTML & CSS it never really clicked until I started to try to put it into practice. But then pasting from MS Word led me astray.
                  Now I am on the right track.
                  • 6. Re: Background color code is not working. Please help
                    Level 7
                    You're Welcome. I'm glad it's starting to make sense for you. Here is, I
                    think, an excellent online reference for CSS:
                    http://reference.sitepoint.com/css

                    --

                    Walt


                    "pppp145pp" <webforumsuser@macromedia.com> wrote in message
                    news:gg97qg$be9$1@forums.macromedia.com...
                    > Thanks Ken and thanks Walt.
                    >
                    > Even though I had done some reading on HTML & CSS it never really clicked
                    > until I started to try to put it into practice. But then pasting from MS
                    > Word
                    > led me astray.
                    > Now I am on the right track.
                    >


                    • 7. Re: Background color code is not working. Please help
                      Level 7
                      > Hi Ken,
                      >
                      > Did you mean to replace
                      > bgcolor: pink;
                      > with
                      > body {background-color: pink};
                      >
                      > I doing that, but it is not working.

                      Your code is wrong. The semi-colon must come immediately at the end of the
                      rule; the curly parenthesis needs to be the last thing in the code for each
                      selector. Thus:

                      body { background-color:pink; }

                      If that still doesn't work... some word-based colours work nicely in CSS...
                      I'm not sure if "pink" is one of them (white, black, red are all definitely
                      safe, but I don't have a list in front of me at the moment)

                      It would be better to find the HTML code for the desired colour and use that
                      instead.

                      E.g. body { background-color:#dec4c5; }

                      BTW, an excellent (and free) tool for detecting colours is Pixie:

                      http://www.nattyware.com/pixie.html

                      --
                      Tim G.
                      http://www.pactumweb.com
                      http://www.shortordersite.com


                      • 8. Background color code is not working. Please help
                        Is there anything that does the same thing as Pixie and will work on a Mac?

                        For those who are not familiar with Pixie this is what their site says it does:
                        "simply point to a colour and it will tell you the hex, RGB, HTML, CMYK and HSV values of that colour".

                        quote:

                        Originally posted by: Tim G

                        BTW, an excellent (and free) tool for detecting colours is Pixie:

                        http://www.nattyware.com/pixie.html



                        • 9. Re: Background color code is not working. Please help
                          Level 7
                          "pppp145pp" <webforumsuser@macromedia.com> wrote in message
                          news:ggb5sb$ncr$1@forums.macromedia.com...
                          > Is there anything that does the same thing as Pixie that will work on a
                          > Mac?
                          >

                          A quick search with "HTML color detector Mac" led me to a link at MacWorld,
                          which in turn led me to this:

                          http://www.radproductions.net/

                          See ColorTagGen at the bottom.

                          I don't work on a Mac, so can't comment personally.

                          --
                          Tim G.
                          http://www.pactumweb.com
                          http://www.shortordersite.com


                          • 10. Re: Background color code is not working. Please help
                            Level 7
                            Digital Color Meter. I think it came with my Mac. Check in
                            /Applications/Utilities to see if you already have it.

                            --
                            Sonjay



                            On 11/23/08 3:56 AM, "pppp145pp" wrote:

                            > Is there anything that does the same thing as Pixie that will work on a Mac?
                            >

                            • 11. Re: Background color code is not working. Please help
                              Level 7
                              Yeah - it's there for me.

                              --
                              Murray --- ICQ 71997575
                              Adobe Community Expert
                              (If you *MUST* email me, don't LAUGH when you do so!)
                              ==================
                              http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
                              http://www.dwfaq.com - DW FAQs, Tutorials & Resources
                              ==================


                              "Sonjay" <my-name@mindspring.com> wrote in message
                              news:C54F4027.41F00%my-name@mindspring.com...
                              > Digital Color Meter. I think it came with my Mac. Check in
                              > /Applications/Utilities to see if you already have it.
                              >
                              > --
                              > Sonjay
                              >
                              >
                              >
                              > On 11/23/08 3:56 AM, "pppp145pp" wrote:
                              >
                              >> Is there anything that does the same thing as Pixie that will work on a
                              >> Mac?
                              >>
                              >

                              1 person found this helpful