Welcome to Dream.In.Code
Become an Expert!

Join 150,399 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 958 people online right now. Registration is fast and FREE... Join Now!




Can any tell me why my color doesnt show up?

 
Reply to this topicStart new topic

Can any tell me why my color doesnt show up?, Begining CSS, no color is showing up, B/W only

decrotizme
24 Feb, 2008 - 01:11 PM
Post #1

New D.I.C Head
*

Joined: 18 Sep, 2007
Posts: 12



Thanked: 2 times
My Contributions
This is my first CSS sheet and I can not get the color to show up for the back ground, the paragraph or the h1
can any one tell me what I did wrong? Thanks in advance for any help I can get.

CODE
<html>

<head>

<title>why cheerleading is so fun</title>

<style type="text/css">

<!--

hr {color: 9932CC}

.h1 {margin-left: 20px; font: bold 8pt "sans-serif"; color: F6F9ED}

.p {font: bold 10pt "arial"; color: "00FF00"}
-->


</style>

</head>

<body>

<h1> Cheerleading is one of the most exciting sports today. Today’s All Star Cheerleaders are
true athletes combining dance, tumbling, and stunting skills. Their is usually only one
very short cheer in a 3 minute routine that basically states the teams name, colors, and a
short motto.  On an All Star team the limits are constantly being pushed, tumbling skills
are a serious must and stunting skills are what gets you the points in competition.
Becoming a cheerleader is a wonderful way to grow up, you learn valuable life long
skill; team work, motivation techniques, how to win, how to loose, and best of all you
stay so busy with 3 and 4 nights a week of practice and competition on the weekends
that you never have time to get into trouble.
</h1>

<p>

Follow this link to find a list of All Star Cheer squads in your area.

</p?

</body>

</html>



User is offlineProfile CardPM
+Quote Post

Jayman
RE: Can Any Tell Me Why My Color Doesnt Show Up?
24 Feb, 2008 - 01:51 PM
Post #2

Student of Life
Group Icon

Joined: 26 Dec, 2005
Posts: 7,327



Thanked: 66 times
Dream Kudos: 500
Expert In: Everything

My Contributions
You have a couple of problems. First remove the period from "h1" and "p" as it doesn't belong when controlling HTML elements. The period is used as a class selector. Next remove the quotes from around the color code that you are using in the "p" tag.

And the last issue is that if you want to control the background color of the page, which is what I assume you meant by background, then you need to add a "body" tag and set the color using the "background-color" attribute. I assumed you were going with the pink background, so that is the color code I used.

Here is the corrected version. The 'hr' tag is a line in HTML, so I am not sure what you were planning on using it for. But I left it in there anyway.

You can find a tutorial on CSS here.
CODE

<html>

<head>

<title>why cheerleading is so fun</title>

<style type="text/css">

<!--
body {background-color: 9932CC}

hr {color: 9932CC}

h1 {margin-left: 20px; font: bold 8pt "sans-serif"; color: F6F9ED}

p {font: bold 10pt "arial"; color: 00FF00}
-->


</style>

</head>

<body>

<h1> Cheerleading is one of the most exciting sports today. Today’s All Star Cheerleaders are
true athletes combining dance, tumbling, and stunting skills. Their is usually only one
very short cheer in a 3 minute routine that basically states the teams name, colors, and a
short motto.  On an All Star team the limits are constantly being pushed, tumbling skills
are a serious must and stunting skills are what gets you the points in competition.
Becoming a cheerleader is a wonderful way to grow up, you learn valuable life long
skill; team work, motivation techniques, how to win, how to loose, and best of all you
stay so busy with 3 and 4 nights a week of practice and competition on the weekends
that you never have time to get into trouble.
</h1>

<p>

Follow this link to find a list of All Star Cheer squads in your area.

</p?

</body>

</html>

User is offlineProfile CardPM
+Quote Post

no2pencil
RE: Can Any Tell Me Why My Color Doesnt Show Up?
27 Feb, 2008 - 02:08 AM
Post #3

My fridge be runnin OH NOEZ!
Group Icon

Joined: 10 May, 2007
Posts: 7,166



Thanked: 78 times
Dream Kudos: 2425
Expert In: Goofing Off

My Contributions
This won't keep your page from loading, but your last end paragraph tag has a typo.

Yours:
html
</p?


Should be:
html
</p>

User is offlineProfile CardPM
+Quote Post

spearfish
RE: Can Any Tell Me Why My Color Doesnt Show Up?
11 Mar, 2008 - 07:47 AM
Post #4

Monkey in Training
Group Icon

Joined: 10 Mar, 2008
Posts: 746



Thanked: 2 times
Dream Kudos: 225
My Contributions
QUOTE(no2pencil @ 27 Feb, 2008 - 03:08 AM) *

This won't keep your page from loading, but your last end paragraph tag has a typo.


I've seen that stop some browsers from loading.

Seems like the other guys helped you out just fine, so I'll expand. The period you were using in ".h1" targets things with a class name of h1, rather than "h1", which targets a tag name of h1.

So if you have
.h1 { color:red; }
you will target this: <p class="h1">; and this: <h1 class="h1">, but not this: <h1>.

You can go even further with h1.h1 {color:red; }, which targets this: <h1 class="h1">; but not this: <h1> or this: <p class="h1"> because it's targeting anything with a tag and class value of "h1"
User is offlineProfile CardPM
+Quote Post

PsychoCoder
RE: Can Any Tell Me Why My Color Doesnt Show Up?
11 Mar, 2008 - 10:21 AM
Post #5

using DIC.Core;
Group Icon

Joined: 26 Jul, 2007
Posts: 9,483



Thanked: 161 times
Dream Kudos: 9075
Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net

My Contributions
Also, remove the quotes you have around the font type you want to use. You also forgot the pound sign (#) before your hex color codes


css

<style type="text/css">

<!--
body {background-color: 9932CC}

hr {color: 9932CC}

h1 {margin-left: 20px; font: bold 8pt Sans-Serif; color: #F6F9ED}

p {font: bold 10pt Arial; color: #00FF00}
-->


That should do the trick smile.gif
User is offlineProfile CardPM
+Quote Post

spearfish
RE: Can Any Tell Me Why My Color Doesnt Show Up?
11 Mar, 2008 - 11:11 AM
Post #6

Monkey in Training
Group Icon

Joined: 10 Mar, 2008
Posts: 746



Thanked: 2 times
Dream Kudos: 225
My Contributions
Nice catch Psycho. I'm so used to just typing in the color names --- it's been a while since I've used hex codes I overlooked the pound part.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/9/09 06:57PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month