FAQ: Languages for Web Development - Applying CSS

This community-built FAQ covers the “Applying CSS” exercise from the lesson “Languages for Web Development”.

Paths and Courses
This exercise can be found in the following Codecademy content:

Code Foundations

FAQs on the exercise Applying CSS

Join the Discussion. Help a fellow learner on their journey.

Ask or answer a question about this exercise by clicking reply (reply) below!

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources? Head here.

Looking for motivation to keep learning? Join our wider discussions.

Learn more about how to use this guide.

Found a bug? Report it!

Have a question about your account or billing? Reach out to our customer support team!

None of the above? Find out where to ask other questions here!

In the index.html file at the very end of the code there are 2 red notification regarding </DOCTYPE!>

  • Its must be in lowercase
  • Its must be paired, no start tag

Yet when reviewing the codes of my earlier lessons on HTML I notice neither have been the case.
The DOCTYPE is always written in capitals and there is actually never a closing tag at the end.
So what going on in this particular code and what is the correct solution to fixing the code ? :smiley:

1 Like

where it says:

On line 6 of index.html , copy and paste the code below to apply the CSS file to the existing HTML.

I’ve tried pasting:

on line 6 before and after" .header{"

No luck. I hit solution and the page changes on the right but the text editor doesn’t at all on line 6

And consistently "Get Help/Solution/Get Code Solution doesn’t return anything other than the original unsolved page. I’ve tried to just keep moving on but not sure why this doesn’t work.

12 Likes

Hi Aurlander,

 I am having the same experience...was there ever a solution?
6 Likes

The code to copy and paste is,

<link rel="stylesheet" href="style.css">

It should be pasted into the HTML document, not the stylesheet. Switch tabs to index.html and paste that on line 6, then Run.


As a complete aside, relating to the earlier question with respect to DOCTYPE, first, it is not an HTML tag, but an SGML tag, being as it is not written inside the <html></html> element. Second, it is not case sensitive so may be written in either lower or upper case.

<!doctype html>
<!DOCTYPE HTML>
<!DOCTYPE html>
<!doctype HTML>

The third one in the list is most typical, but all four are valid and work exactly the same.

26 Likes

Hi Roy,

Thanks very much for taking the time to reply…very useful information. Mike Logan

I had this same issue! I thought I was totally misunderstanding this but glad to hear someone else had this same issue. Thanks for posting

2 Likes

Thank god! I was having the same issue.

1 Like

I have this same issue. I thought it was just me not getting it!

Does anyone else have had the issue that background images weren’t loaded?
I’m trying to see if it is something in my browser settings or something in the stylesheet or html code, but I wasn’t able to find anything yet.

Line 8 and line 94 are missing the semicolon to close the background declaration. Confused me at first and am wondering how they can miss a simple thing like this in the syntax but be teaching at the same time.

paste this and run
line 8 background-image: url(https://content.codecademy.com/programs/code-foundations-path/airplane.jpeg);
line 94 background: url(https://content.codecademy.com/programs/code-foundations-path/shards.png);

“Just for practice, change the color property from **white** to **black** and press Run to see what changes!”

Hi all, just a quick question. On instruction 2, when changing the color properties, **black** doesn’t seem to work, while trying out **red** or **blue** , both do take place and the word appears with the designated property. Any reason why this is happening?

2 Likes

Wow Man! Thanks a lot! I was stuck here for an hour and you came as a life-saver :slight_smile:

1 Like

even after i switch the tab it is still not letting me paste the link when i right click my mouse the option to paste is not even showing up its not my computer because i can paste the link in another doc. on word

In the head of the HTML, add a blank line after the TITLE then position the cursor there. Cmd/Ctrl + v should paste the code.

Hello, I see that we put the HTML link tag to the CSS file on line 6. Could it have been on any line in the HTML file, or was there a specific reason we put it after the title?

1 Like

Hey @imadahmad97 welckme to the forums.

The link tag can be on any line within the head element.

1 Like

Thank you for your quick response! When I add it above the element, at the top (above the tag), it still stylizes the page. Is this just on CodeAcademy or would this happen in regular HTML programming as well?

Just to clarify above the head element.

1 Like

wow thank you very much!!!

3 Likes