Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 8 of 8
  1. #1
    Senior Member thuffner's Avatar
    Join Date
    May 2003
    Posts
    165
    Member #
    1363
    I am not very good with css, and want to know how to make my site the following way using css:
    1. Background color to be white.
    2. All font color to be black.
    3. Font face to be verdana.

    Here is my code that I am currently using (and doesn't work):

    body
    {
    font-family: verdana
    }
    p
    {
    font-family: verdana
    }

    <p style="font-family: verdana">

    body
    {
    background-color: #000000
    }


    Why doesn't it work correctly?
    BondMovies.com - "Nobody Does It Better."

  2.  

  3. #2
    Senior Member
    Join Date
    Apr 2003
    Location
    Hamden Ct
    Posts
    103
    Member #
    1121
    body { font-family: verdana; color: #000000; background: #FFFFFF}

  4. #3
    JR
    JR is offline
    Senior Member JR's Avatar
    Join Date
    Nov 2002
    Location
    UK
    Posts
    4,354
    Member #
    257
    also make sure you do the following if you are using tables...
    Code:
    td {
    font-family: verdana;
    color: #000000;
    }
    JR

  5. #4
    Unpaid WDF Intern TheGAME1264's Avatar
    Join Date
    Dec 2002
    Location
    Not from USA
    Posts
    14,485
    Member #
    425
    Liked
    2783 times
    The other thing you can do to clean up your code is this:

    Code:
    BODY, P, TD {
    font-family:  Verdana, Arial, Helvetica, sans-serif;
    color:  #000000;
    background-color:  #FFFFFF;
    }
    You can reuse styles with multiple elements (e.g. Body, P, TD) by separating them with a comma. I've also added the Arial, Helvetica, sans-serif option in case users don't have Verdana (and there are some that don't).

    From the look of your example above, it appears that either some of your CSS is in the body or some of the HTML is in the head. So either remove the BODY part from the body or the <p style="font-family: verdana"> from the head. I'm not sure which it is because it's a code snippet, but you'll know since you have all of the code and I don't.
    If I've helped you out in any way, please pay it forward. My wife and I are walking for Autism Speaks. Please donate, and thanks.

    If someone helped you out, be sure to "Like" their post and/or help them in kind. The "Like" link is on the bottom right of each post, beside the "Share" link.

    My stuff (well, some of it): My bowling alley site | Canadian Postal Code Info (beta)

  6. #5
    Member a-drive's Avatar
    Join Date
    Mar 2003
    Posts
    94
    Member #
    809
    By default, your pages will be White and text color will be Black. Although you can define these two attributes, you don't have to.

  7. #6
    Senior Member energizze's Avatar
    Join Date
    Oct 2002
    Posts
    260
    Member #
    238
    Originally posted by a-drive
    By default, your pages will be White and text color will be Black. Although you can define these two attributes, you don't have to.

    not necasarily, some windows themes/styles, even some that are inherant in windows, will change the default background colour of web pages.

  8. #7
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    Also, older versions of netscape have gray backgrounds.

  9. #8
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    Incidentally, I think your problem is that you're not putting CSS into a style tag.... try this:

    Code:
    <html>
        <head>
            <style>
                body, p, td, th, li, h1, h2, h3, h4 {
                    font-family:  Verdana, Arial, Helvetica, sans-serif;
                    color:  #000000;
                    background-color:  #FFFFFF;
                }
            </style>
        </head>
        <body>
            <p>This is a test</p>
        </body>
    </html>


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 08:29 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com