Jump to content
Sign in to follow this  
Reisgaar

wrong answer in CSS exercise

Recommended Posts

Hi, maybe you have noticed yet, but just in case:

in the CSS tutorial, in the exercise 3 of "CSS text" ( https://www.w3schools.com/css/exercise.asp?filename=exercise_text3 ), when you give the correct answer it returns "Link has wrong text decoration", even copying the answer gived by the tutorial, it returns the same answer.

Share this post


Link to post
Share on other sites

It certainly seems to be broken.

There's no real way to get in contact with the staff except by using the "Report Error" link at the bottom of the tutorial pages.

Share this post


Link to post
Share on other sites

Same here but pretty remedial stuff with lots of online examples.

Share this post


Link to post
Share on other sites

Be aware that the recent version of Firefox is having some issues with some of the exercises. As an alternative, Chrome works just fine on this question.

  • Like 1

Share this post


Link to post
Share on other sites

Right, blame the fox.

  • Like 1

Share this post


Link to post
Share on other sites
9 hours ago, Ingolme said:

Right, blame the fox.

I just tried in Chrome and it works but Firefox reports an error. This is weird that this is browser independent. Mind= blown.

Share this post


Link to post
Share on other sites
16 hours ago, Ingolme said:

Right, blame the fox.

Oh no, Ingolme!!!

7 hours ago, Steven1 said:

I just tried in Chrome and it works but Firefox reports an error. This is weird that this is browser independent. Mind= blown.

It seems to be an interesting behaviour of window.getComputedStyle() and getPropertyValue("text-decoration")

Its important to note, that the exercise checks for the existence of none inside this property value.

On Firefox, when you've defined the text-decoration as none it actually removes the text-decoration-line(default: underline) and text-decoration-style(solid) keywords from the text-decoration property value. So you're only left with the text-decoration-color. Hence the process fails.

On Chrome, text-decoration is property that seems to be directly combined from text-decoration-linetext-decoration-style, and text-decoration-color. Hence none exists, the process succeeds, and the question is marked correct.

If the question checked for text-decoration-line instead of generic text-decoration, this question would no longer be an issue.

I agree, this is very interesting stuff!

  • Like 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...