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 7 of 7
  1. #1
    New to the CF scene
    Join Date
    Jun 2013
    Location
    United States
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Angry Code Colors Showing Up As All "Greens" - Mac OS X 10.9.2 - Safari 7.0.3

    -screen-shot-2014-04-17-3-00-08-am-png

    This is what I coded for basic purposes... When I open the .html webpage in Safari.. NO MATTER what color I choose, The text & bgcolor are always a "shade" of any type of green.... *UNLESS I use #000000 or #FFFFFF*

  • #2
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    9,114
    Thanks
    6
    Thanked 1,072 Times in 1,044 Posts
    Try this:

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    	<head>
    		<title>Website | Official Site</title>
    		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    		<meta http-equiv="X-UA-Compatible" content="IE=edge;chrome=1" />
    		<meta name="description" content="" />
    		<meta name="keywords" content="" />
    		<style type="text/css">
    		body {
    			background-color: #0F0;
    			color: black;
    		}
    		h1 {text-align: center;}
    		</style>
    	</head>
    	<body>
    		<h1>Header Text</h1>
    	</body>
    </html>

  • #3
    New Coder
    Join Date
    Aug 2009
    Location
    public_html/cgi-bin/
    Posts
    91
    Thanks
    14
    Thanked 1 Time in 1 Post

    Post Re:

    You are using some slightly outdated HTML. I would recommend you begin by also learning the absolute basics of CSS, which handles all the styling of HTML documents.

    Anything associated with the positioning or styling of an element should be kept in an external CSS file. So let's look at this structure:

    index.html
    Code:
    <!DOCTYPE HTML>
    <html>
    <head>
        <title>Official Site</title>
        <link rel="stylesheet" href="style.css" />
    </head>
    <body>
    
    <h1>Heading 1</h1>
    
    <p>Some text here</p>
    
    </body>
    </html>
    And for the CSS, you could have something like this in there:

    style.css
    Code:
    body {
        background-color: #CCC;
        color: #555;
    }
    
    h1 { 
        text-align: center;
    }

    In this example you'd have two files, index.html and style.css.

    Happy coding
    Last edited by Owener94; 04-17-2014 at 01:01 PM.

  • #4
    New to the CF scene
    Join Date
    Jun 2013
    Location
    United States
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Still showing up like this, with the code you provided... : -screen-shot-2014-04-21-9-46-50-pm-png

  • #5
    New to the CF scene
    Join Date
    Jun 2013
    Location
    United States
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    That response was meant for VIPStephan.

  • #6
    New to the CF scene
    Join Date
    Jun 2013
    Location
    United States
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    *However... I did try the same code, I originally coded, on a PC - & it worked just fine..

  • #7
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,903
    Thanks
    23
    Thanked 1,871 Times in 1,855 Posts
    Quote Originally Posted by clade View Post
    Still showing up like this, with the code you provided... : -screen-shot-2014-04-21-9-46-50-pm-png
    Use that code VIPStephan provided but change the background color. #0f0 isgreen.
    Change it where I've highlighted in red below -
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    	<head>
    		<title>Website | Official Site</title>
    		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    		<meta http-equiv="X-UA-Compatible" content="IE=edge;chrome=1" />
    		<meta name="description" content="" />
    		<meta name="keywords" content="" />
    		<style type="text/css">
    		body {
    			background-color: #0F0;
    			color: black;
    		}
    		h1 {text-align: center;}
    		</style>
    	</head>
    	<body>
    		<h1>Header Text</h1>
    	</body>
    </html>
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use a DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad


  •  

    Tags for this Thread

    Posting Permissions

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