HTML Basics III Lesson 9: Style That Head!


#1


Link to lesson https://www.codecademy.com/courses/web-beginner-en-f8mcL/1/4

The instructions are as follows:

Make the "Famous Monster" and "Birth Year" labels emphasized (i.e. make them italicized).
Make the "Famous Monsters by Birth Year" title red.


The following code is not accepted with error

"Oops, try again. Add a 'style' attribute to the first

tag! Set the value of this attribute to 'color:red;'"

       <table style="border-collapse:collapse;">
            <thead>
                <tr>
                    <th colspan="2">Famous Monsters by Birth Year</th>
                </tr>
                <tr style="border-bottom:1px solid black;">
                    <th style="padding:5px; color:red;"><em>Famous Monster</em></th>
                    <th style="padding:5px;border-left:1px solid black; color:red;"><em>Birth Year</em></th>

This code is accepted

<table style="border-collapse:collapse;">
            <thead>
                <tr style="color:red">
                    <th colspan="2">Famous Monsters by Birth Year</th>
                </tr>
                <tr style="border-bottom:1px solid black;">
                    <th style="padding:5px; color:red;"><em>Famous Monster</em></th>
                    <th style="padding:5px;border-left:1px solid black; color:red;"><em>Birth Year</em></th>

There are quite a few posts on this one - Just make sure to make the title red and the headings italicized.


#2

Did you try giving the <th> a style color red, instead of the <tr> ?

Instructions
Make the "Famous Monsters by Birth Year" title red.


#3

I may just delete this post. There is no bug here. You kindly pointed out that the instructions directed one to make the title red, and the headings italicized.

Many people struggled with this because they misread the instructions and tagged the first th as red, when the instructions directed to tag the column headings as read only. Note, this is not what occurs in the accepted code above, despite the fact that it doesn't follow the directions.

The mistake of tagging the title rather than the headings is well documented (here, also here, also here)


#4

we have 3 th tags:

<th>Famous Monsters by Birth Year</th>
<th>Famous Monsters</th>
<th>Birth Year</th>

so famous monsters by birth year (1), famous monsters (2) and Birth year (3)

the color red should be added to famous monsters by birth year (1) or the parent table row (<tr>) tag, then the table cell will inherit the red color from parent.

in the first code you added the red to famous monsters (2), which is why its not working.


#5

Thanks for your response - you are saying that in the first code block I needed to add red to the "famous monsters by birth year," while the italics need to be on "famous monsters" and "birth year." I'm posting this clearly to help others who might be confused.

Note that the instructions allow other modifications to the inline CSS, so having extra red colored text doesn't cause the lesson check to fail.


#6

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.