I am stuck on font color


#1

here is my full code

<!DOCTYPE html>
<html>
	<head>
		<title>Changing the colors!</title>
	</head>
	<body>
		<h1><h2 style="color: green; font-size:16px"> Big Heading
			<p><h2 style="color: violet;">A giant bear and a little duck were friends.</p>
			<p><h2 style="color: red; font-size: 10px;">But the bear got hungry and ate the duck.</p></h1>
	</body>
</html>

the problem is i keep getting an error message saying

Oops, try again. Did you remember to make the h1 header green?

im not sure what i am missing here.


#2

@10dechad,

++++++++ don't know how to use STYLE attribute ++++

<!DOCTYPE html>
<html>
	<head>
		<title>First font size change</title>
	</head>
	<body>
	   <p style = "font-size:8px"> Some text for you to make tiny! </p>
	   <p style = "font-size:10px ; background-color: blue"> Some text for you to make normal size!</p>
	   <p style = "font-size:18px> Some text for you to make super big!</p>
 	</body>
</html>

You see the HTML-page,
with a HEADER characterised by the HEAD-Tags
with a BODY characterised by the BODY-Tags

within the BODY you have 3 PARAGRAPH-Tags

Within the opening-Tag of a HTML-Element like the p-Tag
you can insert so-called attributes.

One of those attributes is the style-attribute
with which you can manipulate the display-style of a HTML-Element.

Now we run into the usage of the word property
Each property consists of a property-key and it's associated VALUE
If you have more then one property you use the semi-colon-; as separator

The syntax of writing a property is
the property-key a colon and it's associated VALUE
thus the font-size-property would look like:
font-size: 12px

As the font-size is a property
of the style-attribute we would write
style = "font-size: 12px"
or ( with multiple properties )
style = "font-size:12px ; background-color: blue"
we are using the semi-colon-; as a so-called separator

We now integrate this into the starting

-Tag


The -background-color of this p-Tag will be blue
and the characters of the TEXT
which we write in-between the p-Tags
will have a font-size of 12 pixels.

Some reference-material:
https://developer.mozilla.org/en-US/docs/Web/CSS/Reference
https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes


#3

now i am getting an error message saying

Oops, try again. Did you remember to make the second paragraph red?

here is my full code

<!DOCTYPE html>
<html>
	<head>
		<title>Changing the colors!</title>
	</head>
	<body>
		<p><h2 style="color: green; font-size:16px"> Big Heading</p>
			<p><h2 style="color: violet;">A giant bear and a little duck were friends.</p>
			<p><h2 style="color: red; font-size: 10px;">But the bear got hungry and ate the duck.</p></h1>
	</body>
</html>

#4

@10dechad,
You want add attributes to the p-Tag
so change your

<p><h2 style="color: green; font-size:16px">

into

<p style="color: green; font-size:16px">

Do the same for the other p-Tags


#5

thanks.
here is my code now

<!DOCTYPE html>
<html>
	<head>
		<title>Changing the colors!</title>
	</head>
	<body>
	<h1>
		<p style="color: green; font-size:16px"> Big Heading</p>
			<p style="color: violet;">A giant bear and a little duck were friends.</p>
			<p style="color: red; font-size: 10px;">But the bear got hungry and ate the duck.</p></h1>
	</body>
</html>

and i still got the error message

Oops, try again. Did you remember to make the h1 header green?

#6

Please remove

....

and your code will work. As already leonhard_wettengmx_n has explained in his code.







Big Heading


A giant bear and a little duck were friends.


But the bear got hungry and ate the duck.




#7

sorry for the previous post.


#8


heres my code. In the changing of the font size to 16px, when I submit the code, it says, "looks like your font size is 32px instead of 16px.
What should I do???


#9

Its font-size not font size add a - and it should work if not hit ctrl + 0 or refresh the page and try to continue.