Loading ...
Sorry, an error occurred while loading the content.

Can't set background color properly, have a look at my simple html/css

Expand Messages
  • snowman908070
    Trying the set the entire background of the page the color #cccccc, and I can t! What am I doing wrong?
    Message 1 of 2 , Aug 17, 2008
    • 0 Attachment
      Trying the set the entire background of the page the color #cccccc,
      and I can't!

      What am I doing wrong?



      <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

      <HTML>
      <HEAD>
      <TITLE> New Document </TITLE>
      <!-- css -->
      <link rel="stylesheet" type="text/css"
      href="http://yui.yahooapis.com/2.5.2/build/reset-fonts-grids/reset-fonts-grids.css">

      <!-- js -->
      <script type="text/javascript"
      src="http://yui.yahooapis.com/combo?2.5.2/build/utilities/utilities.js"></script>


      <style>

      #doc
      {
      background-color: #cccccc;
      }

      </style>
      </HEAD>

      <BODY>
      <div id="doc" class="yui-t1">
      <div id="hd">
      <p>Header.</p>
      </div>
      <div id="bd">


      <div id="yui-main">
      <div class="yui-b">

      <p>Main B.</p>
      </div>
      </div>

      <div class="yui-b">
      <p>B - .</p></div>

      </div>

      <div id="ft">
      <p>Footer.</p>
      </div>
      </div>

      </BODY>
      </HTML>
    • Frank Dietrich
      ... Without testing, I think Your outer div #doc will become #cccccc. You should see it when You give some fixed dimensions or add some content *outside* of
      Message 2 of 2 , Aug 17, 2008
      • 0 Attachment
        >Trying the set the entire background of the page the color #cccccc,
        >and I can't!
        >
        >What am I doing wrong?
        >...
        > <style>
        >
        > #doc
        > {
        > background-color: #cccccc;
        > }
        >
        > </style>
        > </HEAD>
        >
        > <BODY>
        > <div id="doc" class="yui-t1">
        > <div id="hd">
        > <p>Header.</p>
        >....

        Without testing, I think Your outer div #doc will become #cccccc. You should see it when You give some fixed dimensions or add some content *outside* of the then following inner divs. The hd, bd... classes have their own background settings, when coming from YUI thus ignoring the outer setting. If You have firebug, You should be able to see this in the CSS section.

        what You should do is overriding the hd, bd, ... if they are below #doc something like

        #doc .hd,
        #doc .bd,
        #doc .ft {
        background-color: #cccccc;
        }

        but I'm no CSS guru and oftenly enough need to find the correct setting with the help of firebug switching and tweaking.


        www.dd-tech.de - www.personalplanung.com - www.kulturbox.de




        Dipl. Kfm. Frank Dietrich Tel: +49-30-845 777-0
        Dietrich Datentechnik Fax: +49-30-845 777-19
        Leo-Baeck-Str. 22 e-mail: Frank.Dietrich@...
        D-14165 Berlin

        Dietrich Datentechnik Tel: +49-3328-310 380
        Rheinstr. 8 Fax: +49-3328-310 388 o.r.
        D-14513 Berlin-Teltow e-mail: fdietrich@...
      Your message has been successfully submitted and would be delivered to recipients shortly.