Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    New Coder
    Join Date
    Dec 2003
    Posts
    85
    Thanks
    0
    Thanked 0 Times in 0 Posts

    backround color in HTML

    i'm very new at HTML. Is there a way to change the backround color of a page with it?

  • #2
    Banned
    Join Date
    Sep 2003
    Posts
    3,620
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Try this:
    Code:
    <body bgcolor="#FFFF0F">
    <a href="javascript:void(document.bgColor=prompt('Background Color','#C0C0C0'))">
    Change BgColor</a>
    .....Willy

  • #3
    New Coder
    Join Date
    Dec 2003
    Location
    California
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts
    It's a lot better and easier to use CSS.

    Just put the following snippet inside your <head>

    Code:
    <style type="text/css">
    body {
      background: #ff0;
      }
    </style>
    // freak

  • #4
    New Coder
    Join Date
    Dec 2003
    Posts
    85
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thanx, those work great! since freak's looked a little shorter I used it, but, if yellow isn't my color, what do I change to change the color?

  • #5
    Banned
    Join Date
    Sep 2003
    Posts
    3,620
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Oh, I thought you wanted to change the background color once the page was displayed.

    To change the background color in freaks example.
    Change the hexidecimal number highlighted in red

    eg: background: #ff0;

    You can find some additional color values here.

    ......Willy

  • #6
    Regular Coder
    Join Date
    Dec 2003
    Location
    UK
    Posts
    106
    Thanks
    0
    Thanked 0 Times in 0 Posts
    the_bob

    Have a look at the tutorials on www.w3schools.com

    They are very quick and easy and are broken down into individual bitesize sections

    Give them a shot - you won't look back!!

    Monkey

    [edit:] Fixed your link url ... had an extra dot (.)
    Last edited by Mhtml; 01-19-2004 at 09:43 PM.

  • #7
    New Coder
    Join Date
    Jan 2004
    Posts
    27
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Here's some more CSS basics and I would highly recommend you to use external CSS vs. internal.

    http://www.webdevfaqs.com/css.php

  • #8
    New to the CF scene
    Join Date
    Jan 2004
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for that link. It is resourceful.

  • #9
    New Coder
    Join Date
    Dec 2003
    Posts
    85
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ya, i just checked those out. Great sites! thanx


  •  

    Posting Permissions

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