26 not seeing link text

I’m getting an error message on 26 asking me if I’ve put in link text between my <a> tags. I have. One time it told me my code was correct, then looped me back to the same lesson and started giving me the error again. I’ve checked the HTML and the CSS and do not know where the error is that is causing it not to see the text. It is displaying correctly in the results box. Anyone got any thoughts?



{font-family: Verdana, sans-serif; color: #576D94}
{font-size:18px; color: #4A4943; font-family: garamond, serif}
{height: 100px; width: 300px; border: 1px solid #4682b4;}
{text-decoration: none; color: #cc0000}

It looks like there is a line break in the anchor OPENTAG. <a> should not have a line break. The link text can have all the line breaks we want, but that’s another story. In other words,

    <a href="#">
    Link text

is valid.

From a style guide perspective, the CSS should be written with the selector on the same line as the declaration block.

h1 {}
p {}
img {}
a {}

When writing multiple selectors, ‘stacking’ is often recommended for readabiity:

h4 { font-weight: normal; }

I don’t understand what you mean by line break.

A line break is a hard return, or newline. Your code above looks like it has one in it:

    <a href=" ... "
    >Link Text</a>

@mtf check the line numbers, I think it’s just line wrapping making it look like that.

Right you are. (facepalm). Thanks for pointing that out.


That’s what I thought you might mean. But it doesn’t have one. It is just carrying the bracket down on its own. When I take away the indention, it’s all together. I have double checked, I have deleted and retyped the code a million times, I have typed in different link text. Totally stymied.

@pyjumper77675 Could you copy/paste your code into here, then format it? I think the problem might be your spaces such as here:

<element attribute= "value">
                   ^ that space

But I’m not sure and would like to check :slight_smile:

You can format code by selecting it all while in the post editor, and pressing Ctrl/Cmd + K, or by adding a new line and three backticks (`) before and after your code, like this:

<code> will show up properly here


Copy your code, and save it, then replace the content with this…

    <h1>I sometimes get a little mad when coding.</h1>
    <p>I need to start planning out my day becasue I get a whole bunch done and I can keep a tight schedule.</p>
    <img src="http://i.space.com/images/i/000/004/618/i02/090917-adromeda-galaxy-02.jpg?1292269284"/>
    <a href="http://www.google.com">google</a>

But first, try to refresh the page and Submit again,. just to be sure it’s not a page issue. If it still won’t pass, then substitute with the above, and if it passes, look for differences.

Ah, I see @zystvan just mentioned something.

I’ve put in spaces. I’ve taken out spaces. I’ve wiped it out and redone it and redone it and redone it, and no good…except it DID take it that one time and then start me over.

I tried pasting in the code you posted here, mtf, but it gives me the exact same error, even though it shows up fine in the results box just like mine did.

@pyjumper77675 Maybe try switching browsers, then? @mtf’s code should work.
Also, it might be worth disabling all browser addons/extensions, because occasionally they’ll interfere with Codecademy.

<!DOCTYPE html>
    <link type= "text/css" rel= "stylesheet" href= "stylesheet.css" />
        <p>blah blah blah</p>
        <img src= "https://upload.wikimedia.org/wikipedia/commons/thumb/0/0a/Corvus-brachyrhynchos-001.jpg/220px-Corvus-brachyrhynchos-001.jpg" />
<a href= "https://en.wikipedia.org/wiki/Corvus_%28genus%29">
Link text

It may not be exactly the same as I’ve been changing spaces and indents, trying to get it to work, in between messages.

Okay, I’ll try it in Explorer, er, Edge. Whatever they’re calling it these days! :slight_smile:

1 Like

Hey your code works, refresh. :smiley:

I tried copy pasting your code on there, and it passes. If it still occurs, maybe semi colons after your css styles(or whatever you call them)?


Never mind. There’s actually no problems in your code, it passes well, and I just found out that you don’t need semi colons after your styles. :sweat_smile:

Thanks! My code works in Edge with no problems. Nice to know I was not going crazy. Thanks again for the help!

1 Like

@pyjumper77675 – What browser were you using before?

I have tried three different browsers, reviewed the code over and over… all the code is “lit” the correct colors. This is driving me nuts, is it a known bug on CA?

I need help with this Zystvan… I’ve tried everything…

As this thread is for the most part resolved for the OP, perhaps you wouldn’t mind posting a new topic in the Platform subcategory of the Codecademy Community Lounge?

Please include the following in your post:

  • The track and module (HTML & CSS - 7. CSS: An Overview)
  • A link to the lesson
  • A description of the problem (error messages)
  • Your code samples
  • The OS and browsers you have tried using
1 Like