This community-built FAQ covers the “Tag Name” exercise in Codecademy’s CSS lessons.
FAQs on the CSS exercise Tag Name
Join the Discussion. We Want to Hear From You!
Have a new question or can answer someone else’s? Reply () to an existing thread!
Agree with a comment or answer? Like () to up-vote the contribution!
Need broader help or resources about CSS in general? Go here!
Want to take the conversation in a totally different direction? Join our wider discussions.
Learn more about how to use this guide.
Found a bug? Report it!
Have a question about your account, billing, Pro, or Pro Intensive? Reach out to our support team!
None of the above? Find out where to ask other questions here!
Other FAQs
The following are links to additional questions that our community has asked about this exercise:
- This list will contain other frequently asked questions that aren’t quite as popular as the ones above.
- Currently there have not been enough questions asked and answered about this exercise to populate this FAQ section.
- This FAQ is built and maintained by you, the Codecademy community – help yourself and other learners like you by contributing!
Not seeing your question? It may still have been asked before – try searching for it by clicking the spyglass icon () in the top-right of this page. Still can’t find it? Ask it below by hitting the reply button below this post ().
In CSS selector, can I indicate a specific element in HTML. With just p selector, It’s going to change the all p elements in the HTML, so I wonder how can I designate one element by using selector in CSS.
1 Like
I am geting CSS course, on one practise a cant go next…but I thing that I did it right…
In style.css , add a selector for <h1>
elements. then Inside the curly braces of the h1
selector you just declared, write:
color: maroon;
I did this: h1
{
color: maroon;
}
Whats wrong?
2 Likes
p, h1 {
font-family: Arial;
color: maroon;
}
me too but this is solution is ok finaly
Sorry for late response to your question, but it’s looking specifically for the first { to be on the same line as h1, like so:
h1 {
color: maroon;
}
1 Like
what if we wanted to specify our tag say we had two <p>
tags what would we do if we wanted one to be
red and one to be yellow
In the upcoming lessons (same section) you will learn about classes, ID’s where you will learn to assign different classes to different elements and then you can style each class.
Can you write the code either way?
h1 {
color:maroon;
}
OR
h1 {color:maroon;}
1 Like
Hi @net4447221503
Despite the fact both ways work, you should always stick to the first syntax as that’s the standard for CSS.
h1 {
color: maroon;
}
1 Like
I’ve typed in the code correctly and it’s given me a tick and allows me to go onto the next page, but my code has not changed the example at all. It’s still Times New Roman and in black. What have I done? My code is
h1 {
color: maroon;
}
3 Likes
When styling an html element with css, I noticed that the course tells us to write: “color: maroon;”
This is obviously American English. If I use British English (“colour: maroon”) or other British spellings in future css lessons, will it still work?
1 Like
I was stuck with this as well, even the solution code did not work. I switched browsers to Chrome from Edge and it works perfectly now. This must be an issue with the environment within Edge.
1 Like
my header won’t change color.
A late answer here, but I have the same question in mind and decided to play it with my editor. Turned out if I set up in .css:
p {
color: maroon;
{
while I have more than one <p>
element in our .html file, it works to go to a specific <p>
and set it up differently with inline CSS styling:
This line should be teal, not maroon
Still looking if anybody can point up a more efficient solution.
I was playing around and noticed that an inline styling in the index.html file overwrote the styling in the style.css file.
html = red ; css = green ; result = red ;
Is this the norm? And if so, is this why we do not want to perform html styling? So that if we want to just change the styling of a site, but not the layout, we can simply switch out the style.css with another or only change it in one place as the case maybe.
You can also add an id attribute to the paragraph in question. Write it out as such.
<p id= "specific styling">
_____________________________
#specific styling {
color:maroon;
}
No, CSS only takes the better version of English
But for real, I googled it and apparently CSS only recognizes American English, and, If I’m not mistaken, this is common for many programming languages.
Yes, inline styling takes precedence over any other form of CSS styling (except !important
).
You want to avoid using inline styling because it is easier to manage styling from one page (the css styling page) and to avoid cluttering up your html with CSS or other types of code. This is called “seperation of concerns” and is worth a google search
Literally here to see if anyone else was asking this, thanks!
It’s a shame, because I’m a copywriter who mostly does work in Australian, NZ and UK markets. And now learning to code in US English is going to do my head in.