www.webdeveloper.com
Results 1 to 5 of 5

Thread: Home Page Background Color Quandary

  1. #1
    Join Date
    Dec 2002
    Posts
    83

    Question Home Page Background Color Quandary

    My site is created in MS Publisher, which does not allow for multiple background page colors, which I am trying to accomplish. I would like my home page to have a black background; & all the others a white background. WYSIWYG I know...HTML I do not (well...some.)

    I thought I had accomplished this by framing the home page with a picture box; & then flood filling that frame with black (after layering all my graphics & text forward.) When I previewed the site in my browser (IE), it looked great. I converted the site to HTML & uploaded to my server; & what is happening with the home page is: when the site is logged onto, the page background is white for a moment; & then becomes black, which doesn't look very professional.

    My question is: If I remove the black flood fill from my home page; & then, for that page, follow the standard rule, which I believe would be BGCOLOR=black (in the BODY tag between the entries BODY & >), will that work? Or is there something else I am missing?

    Thanks in advance,

    mark4man

  2. #2
    Join Date
    Nov 2002
    Posts
    984
    Originally posted by Dave Clark

    though it is possible some smart@$$ may come along and say that you should specify your colors via CSS styles -- not in the BODY tag's attributes.

    Dave [/B]
    Of cource dope heads still living in the 1990ies are obvously not familear with that you can specify CSS inline as a "BODY tag attribute".

    <body style="background:black; color:white">

    Which method you end up using pretty much depends on if you would like to learn how people USED to code webpages or how to do it in the future.
    Currently we are at a crosspoint in time where people are slowly moving from the old way to the new way so either method will work just fine.
    // Stefan Huszics

  3. #3
    Join Date
    Dec 2002
    Posts
    83

    Fellas,

    Dave,

    Thanks much. Question, tho: Why the entry for text directly after the entry for bgcolor?

    Stefan,

    Thanks much. Question, tho: Why the entry for color (white) directly after the entry for background (black)?


    Question for both you guys (without starting a major ruckus):

    Which system (structured code vs. styles) is better? Or is it...I've always understood that ideally it's a combination of the two...straight code for standard formatting & css for aesthetic design. How about browser compatibility?

    Thanks in advance,

    mark4man

  4. #4
    Join Date
    Dec 2002
    Posts
    83

    Dave!

    At the risk of sounding like a total homer...I must tell you:

    IT WORKED! IT WORKED! IT REALLY FR_ _ _KIN' WORKED! I'M SO FR_ _ KIN' HAPPY!

    First of all, Publisher must generate in css, because I found this entry just below <title>:

    <style type="text/css"><!--

    (I have this feeling I should have known this already.)

    The <BODY> tag was below the </style> tag, near the middle of the page; & below all the headings (which incidently, from Publisher, look like:

    #NormalP {
    text-align: left;
    margin-top: 0.0pt;
    margin-bottom: 0.0pt;
    }

    #PubSt1F {
    PublisherStyleName: PubSt1;
    font-family: Times New Roman;
    font-size: 4.0pt;
    color: #000000;

    (as opposed to: <H1>) That's weird. Is that what is meant by "bloating" the code?

    The entry was: <body bgcolor="#FFFFFF" link="#0066ff" vlink="#cc3366" text="#000000" topmargin=0 leftmargin=0>, which I changed to: #000000, per your recommendation [& I had also found it last night in Elizabeth Castro's book (HTML4.)]

    Now, I have to find the code generated by the flood filled frame I created in the damn WYSIWYG app to get my black page in the first place...& delete it.

    In the future, I'll leave all my pages standard white in the editor & just change the code. I'm also going to make a honest effort to learn HTML. I like WYSIWYG, for the aesthetic freedom associated with visual page layout, but there's just no substitute for understanding the structure behind it all.

    Thanks again,

    mark4man

  5. #5
    Join Date
    Nov 2002
    Posts
    984

    Re: Fellas,

    Originally posted by mark4man
    [B]Dave,
    Why the entry for color (white) directly after the entry for background (black)?
    I was providing the equivalent of the code posted by Dave and just as he said the important thing here is to provide a contrasting color.
    Some visitors might be using custom colors for text and background and if you just specify 1 of them it might turn the page unreadable for them.

    Which system (structured code vs. styles) is better?
    In your very simple example the 2 codes are pretty much equal.
    However the real benefit of CSS is that you can compleatly separate the webpage content from the style & formating by placing all style code in an externally linked file.
    This means that you can controll every detail of your entire site from 1 single file.
    If you eg have 10 pages and want to change the background from black to grey, you just change 1 value in this 1 file and each of the 10 pages is instantly updated.
    It saves a lot of time when making your website as well as maintaining it and additionally you neve risk forgetting to update 1 of the pages.

    Also, since you don't need to provide the same style and formating information on each page of your site, the entire site will also be quicker for visitors to download and require less bandwidth.

    There are other benefits with using CSS too, but the above is usually more then enough to make people realize that they really want to use CSS.

    How about browser compatibility?
    Simple things like text and backgrounds work quite well even in old browsers like NS 4 and IE 4.
    The newer the browser the more advanced stuff you can do with CSS.
    With eg Opera 7beta, IE6 and Mozilla (NS 7) you can easily replicate in just a few lines of code what used to require large DHTML scripts, eg like popup menus.
    Last edited by Stefan; 12-18-2002 at 11:41 PM.
    // Stefan Huszics

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles