freecodecamp.cn icon indicating copy to clipboard operation
freecodecamp.cn copied to clipboard

HTML挑战-Nest an Anchor Element within a Paragraph

Open wanderiing opened this issue 10 years ago • 21 comments

2017年1月20日更新:

看到有较多的人回复了该问题,说明不少人都会在这里卡顿,因此reopen问题,希望相关翻译人员能够考虑是否可以优化下问题表述。 (可能已经做了优化,感觉问题的表述跟以前看到的不一样了,如果已经优化或解决,烦请管理员关闭该问题)

另贴出可执行成功的代码(这个问题本身其实并不复杂,所以直接贴出代码,尽量避免大家在此浪费时间)

<link href="https://fonts.gdgdocs.org/css?family=Lobster" rel="stylesheet" type="text/css">
<style>
  .red-text {
    color: red;
  }

  h2 {
    font-family: Lobster, Monospace;
  }

  p {
    font-size: 16px;
    font-family: Monospace;
  }

  .thick-green-border {
    border-color: green;
    border-width: 10px;
    border-style: solid;
    border-radius: 50%;
  }

  .smaller-image {
    width: 100px;
  }
</style>

<h2 class="red-text">CatPhotoApp</h2>

<p>View more <a href="http://www.freecatphotoapp.com">cat photos</a></p>

<img class="smaller-image thick-green-border" src="/images/relaxing-cat.jpg">

<p class="red-text">在大家心目中,猫是慵懒的可爱的化身,它可以睡饱了再起来吃饭,可以逗趣小耗子,可以卖得了萌,使得了坏,这样百变的小怪兽就集结在一只宠物上,怎能不惹人怜爱。</p>
<p class="red-text">养动物有的时候,就是介于爱与恨之间,当你钦羡别人萌宠这么可爱的时候,你一定没有想过,狗狗和猫猫会到处拉屎,甚至会屯老鼠,啃鞋子,用爪子爬门,你不理它,它就挠你,你要对它发脾气,它会比你更来劲。所以,狗猫慎入,没有一定的准备,切勿随便去侍养动物。它们一旦认定你了,你就是它们的主人,如果你抛弃它们,它们必定心中重创。</p>

2016年11月8日原问题描述: 运行始终提示有一项不成功(“你的p元素应该包含文本"View more ",注意more后面有一个空格。”) ,但同样代码在英文版中就可以成功。

代码如下:

<link href="https://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>
  .red-text {
    color: red;
  }

  h2 {
    font-family: Lobster, Monospace;
  }

  p {
    font-size: 16px;
    font-family: Monospace;
  }

  .thick-green-border {
    border-color: green;
    border-width: 10px;
    border-style: solid;
    border-radius: 50%;
  }

  .smaller-image {
    width: 100px;
  }
</style>

<h2 class="red-text">CatPhotoApp</h2>

<a href="http://www.freecatphotoapp.com">cat photos</a>
<p>View more <a href="http://www.freecatphotoapp.com">cat photos</a></p>
<img class="smaller-image thick-green-border" src="https://bit.ly/fcc-relaxing-cat" alt="A cute orange cat lying on its back. ">

<p class="red-text">Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
<p class="red-text">Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>

wanderiing avatar Nov 08 '16 09:11 wanderiing

中文版的怎么写代码呢?我写了很多都是不成功,显示你的p元素应该包含文本"View more ",注意more后面有一个空格 这是我写的代码

Here's a link to cat photos View more cat photos.

ChengSisi avatar Nov 19 '16 09:11 ChengSisi

是按照要求操作的,还是不成功 #

xuxingxing avatar Nov 30 '16 07:11 xuxingxing

我的也是显示你的p元素应该包含文本"View more " 我的代码没问题

CatPhotoApp

View more cat photos

卡在这里了 什么问题?

szmacio avatar Nov 30 '16 10:11 szmacio

me too

countingstep avatar Dec 05 '16 05:12 countingstep

me too

19931205YHP avatar Dec 14 '16 02:12 19931205YHP

“把你的a元素嵌套进一个新的p元素” 这句的翻译可能有些问题。 我之前也试了很多次,都不成功,后来在原有的 p 元素中加入锚点 a,就成功了,不要重新新增一个 p 元素。 你们可以试试。

在 2016年12月14日,10:28,19931205YHP [email protected] 写道:

me too

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/FreeCodeCampChina/freecodecamp.cn/issues/48#issuecomment-266924972, or mute the thread https://github.com/notifications/unsubscribe-auth/AT3VuI9KuUC4eyxHaKw7f08KCECRJ2d0ks5rH1RUgaJpZM4KsMfr.

wanderiing avatar Dec 14 '16 02:12 wanderiing

我已经解决了。聊天室里 ”mougua“ 是这么说的:“下面多余的标签删掉”。

所以“删掉下面多余的标签”是指什么啊QAQ

Eseks avatar Dec 14 '16 07:12 Eseks

@BBpiano 是这样子的,这个任务里面,我们只保留一个<a>,把在以前任务中的<a>标签先删掉即可通过任务。这样说明白了嘛?

TecFancy avatar Dec 14 '16 14:12 TecFancy

同样的问题,觉得还是去用英文版好了

sunbear-yang avatar Jan 02 '17 06:01 sunbear-yang

我的是在这段代码的位置 《P》view more 《a href="http://www.freecatphotoapp.com"》cat photos《/a》 《/p》 我只要把最后的“《/p》”删掉就能完成,可是删掉明显不对啊!

Xy8023 avatar Jan 04 '17 11:01 Xy8023

code:


CatPhotoApp

View more cat photos

***********

can run success!

KaapoMarcus avatar Jan 06 '17 00:01 KaapoMarcus

《a href="http://www.freecatphotoapp.com"》cat photos《/a》 这一句移动到 新添加的p标签内 即可运行成功。

KaapoMarcus avatar Jan 06 '17 01:01 KaapoMarcus

我想我们都没仔细看需求,这肯定是他们给我们的一个小小的坑,不知道大家仔细看到上面的需求没,,本页面仅有 cat photos 是个链接,其他的都是普通文本,,

shendengnian avatar Jan 07 '17 14:01 shendengnian

按照楼上大哥的说法改的,确实成功了,不过问题明显不是“你的p元素应该包含文本"View more ",注意more后面有一个空格。”,在这里标记错误是不是会有误导的感觉??不过没看清题目确实是大大的失误啊2333

CatPhotoApp

View more cat photos

在大家心目中,猫是慵懒的可爱的化身,它可以睡饱了再起来吃饭,可以逗趣小耗子,可以卖得了萌,使得了坏,这样百变的小怪兽就集结在一只宠物上,怎能不惹人怜爱。

Eseks avatar Jan 07 '17 15:01 Eseks

是的,我成功了,把原有的a标签那句删除掉就可以过了,只留你新写的a标签

sausagehwx avatar Feb 13 '17 05:02 sausagehwx

确实只要把原有的a标签那句删除掉就可以过了,只留新写的a标签。。。

yangpop236 avatar Feb 14 '17 06:02 yangpop236

其实这题不就是在原有的

<a href="http://www.freecatphotoapp.com">cat photos</a>

套一层

就解决问题了呀 然而这里要求再加一点内容 就成了

<p>View more <a href="http://www.freecatphotoapp.com">cat photos</a></p>

这题就完成了

wudifeixue avatar Feb 16 '17 21:02 wudifeixue

@shendengnian 谢谢啊 ,解决了 ,还是粗心大意了

daydayupstudy avatar Mar 01 '17 03:03 daydayupstudy