Django for Everybody CSS Autograder作业卡在尝试制作复制页面上。

huangapple go评论91阅读模式
英文:

Django for Everybody CSS Autograder assignment stuck on trying to make replica page

问题

I have been trying to complete this assignment. I have completed the majority of it but I am stuck of the DJ4E sign. If you use the link below you will see what it is meant to look like.

我一直在尝试完成这项任务。我已经完成了大部分工作,但我卡在了DJ4E标志上。如果您使用下面的链接,您将看到它应该是什么样子的。

Specifics I am stuck on:

  1. How to remove the purple from from DJ4E text ( it is a link ) so now purple since the link has been visited.
  2. DJ4E should be just above the boxes ( see link for pic)

我卡住的具体问题是:

  1. 如何去掉DJ4E文本中的紫色(它是一个链接),因为链接已被访问而变成了紫色。
  2. DJ4E应该位于方框的正上方(请参见图片链接)。

Here is the link to the assignment: https://www.dj4e.com/assn/css/index.php

这是任务的链接:https://www.dj4e.com/assn/css/index.php

HTML code (not meant to change):

HTML代码(不应更改):

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>Blocks</title>
  5. <!-- Do not change this file - add your CSS styling
  6. rules to the blocks.css file included below -->
  7. <link type="text/css" rel="stylesheet" href="blocks.css">
  8. </head>
  9. <body>
  10. <div id="one">
  11. Turns out you have a really fun time if you
  12. go to work every day and focus on being
  13. silly and funny and happy! - Hannah Murray
  14. </div>
  15. <div id="two">
  16. All you need in this life is ignorance and confidence,
  17. and then success is sure. - Mark Twain
  18. </div>
  19. <div id="three">
  20. Well, if crime fighters fight crime and fire fighters
  21. fight fire, what do freedom fighters fight? They never
  22. mention that part to us, do they? - George Carlin
  23. </div>
  24. <div id="four">
  25. Great minds discuss ideas; average minds discuss events;
  26. small minds discuss people. - Eleanor Roosevelt
  27. </div>
  28. <p id="link">
  29. <a href="https://www.dj4e.com/" target="_blank">
  30. DJ4E
  31. </a>
  32. </p>
  33. </body>
  34. </html>

My CSS code that I have developed and can be edited:

我开发的可以编辑的CSS代码如下:

  1. #one {
  2. /*correct*/
  3. position: fixed;
  4. width: 25%;
  5. bottom: 5px;
  6. right: 5px;
  7. padding: 5px;
  8. margin: 5px;
  9. border: 5px solid blue;
  10. }
  11. #two {
  12. /*correct*/
  13. position: fixed;
  14. width: 25%;
  15. top: 5px;
  16. right: 5px;
  17. padding: 5px;
  18. margin: 5px;
  19. border: 5px solid green;
  20. }
  21. #three {
  22. /*correct*/
  23. position: fixed;
  24. width: 25%;
  25. top: 5px;
  26. left: 5px;
  27. padding: 5px;
  28. margin: 5px;
  29. border: 5px solid orange;
  30. }
  31. #four {
  32. /*correct*/
  33. position: fixed;
  34. width: 25%;
  35. bottom: 5px;
  36. left: 5px;
  37. padding: 5px;
  38. margin: 5px;
  39. border: 5px solid yellow;
  40. }
  41. #link {
  42. position: absolute;
  43. top: 0;
  44. left: 50%;
  45. font-size: 1.64rem;
  46. background-color: #0A4B33;
  47. box-sizing: border-box;
  48. font-family: 'Roboto', Corbel, Avenir, 'Lucida Grande', 'Lucida Sans', sans-serif;
  49. color: white;
  50. height: 50px;
  51. padding: 15px 15px;
  52. line-height: 20px;
  53. margin: -15 ;
  54. text-decoration: none;
  55. text-decoration-line: none;
  56. text-decoration-thickness: initial;
  57. text-decoration-style: initial;
  58. text-decoration-color: initial;
  59. }

My progress as a picture:
Django for Everybody CSS Autograder作业卡在尝试制作复制页面上。

我的进度如下图片所示:Django for Everybody CSS Autograder作业卡在尝试制作复制页面上。

英文:

I have been trying to complete this assignment. I have completed the majority of it but I am stuck of the DJ4E sign. If you use the link below you will see what it is meant to look like.

Specifics I am stuck on:

  1. How to remove the purple from from DJ4E text ( it is a link ) so now purple since the link has been visited.
  2. DJ4E should be just above the boxes ( see link for pic)

Here is the link to the assignment: https://www.dj4e.com/assn/css/index.php

HTML code (not meant to change):

  1. &lt;!DOCTYPE html&gt;
  2. &lt;html&gt;
  3. &lt;head&gt;
  4. &lt;title&gt;Blocks&lt;/title&gt;
  5. &lt;!-- Do not change this file - add your CSS styling
  6. rules to the blocks.css file included below --&gt;
  7. &lt;link type=&quot;text/css&quot; rel=&quot;stylesheet&quot; href=&quot;blocks.css&quot;&gt;
  8. &lt;/head&gt;
  9. &lt;body&gt;
  10. &lt;div id=&quot;one&quot;&gt;
  11. Turns out you have a really fun time if you
  12. go to work every day and focus on being
  13. silly and funny and happy! - Hannah Murray
  14. &lt;/div&gt;
  15. &lt;div id=&quot;two&quot;&gt;
  16. All you need in this life is ignorance and confidence,
  17. and then success is sure. - Mark Twain
  18. &lt;/div&gt;
  19. &lt;div id=&quot;three&quot;&gt;
  20. Well, if crime fighters fight crime and fire fighters
  21. fight fire, what do freedom fighters fight? They never
  22. mention that part to us, do they? - George Carlin
  23. &lt;/div&gt;
  24. &lt;div id=&quot;four&quot;&gt;
  25. Great minds discuss ideas; average minds discuss events;
  26. small minds discuss people. - Eleanor Roosevelt
  27. &lt;/div&gt;
  28. &lt;p id=&quot;link&quot;&gt;
  29. &lt;a href=&quot;https://www.dj4e.com/&quot; target=&quot;_blank&quot;&gt;
  30. DJ4E
  31. &lt;/a&gt;
  32. &lt;/p&gt;
  33. &lt;/body&gt;
  34. &lt;/html&gt;

My CSS code that I have developed and can be edited:

  1. #one {
  2. /*correct*/
  3. position: fixed;
  4. width: 25%;
  5. bottom: 5px;
  6. right: 5px;
  7. padding: 5px;
  8. margin: 5px;
  9. border: 5px solid blue;
  10. }
  11. #two {
  12. /*correct*/
  13. position: fixed;
  14. width: 25%;
  15. top: 5px;
  16. right: 5px;
  17. padding: 5px;
  18. margin: 5px;
  19. border: 5px solid green;
  20. }
  21. #three {
  22. /*correct*/
  23. position: fixed;
  24. width: 25%;
  25. top: 5px;
  26. left: 5px;
  27. padding: 5px;
  28. margin: 5px;
  29. border: 5px solid orange;
  30. }
  31. #four {
  32. /*correct*/
  33. position: fixed;
  34. width: 25%;
  35. bottom: 5px;
  36. left: 5px;
  37. padding: 5px;
  38. margin: 5px;
  39. border: 5px solid yellow;
  40. }
  41. #link {
  42. position: absolute;
  43. top: 0;
  44. left: 50%;
  45. font-size: 1.64rem;
  46. background-color: #0A4B33;
  47. box-sizing: border-box;
  48. font-family: &#39;Roboto&#39;, Corbel, Avenir, &#39;Lucida Grande&#39;, &#39;Lucida Sans&#39;, sans-serif;
  49. color: white;
  50. height: 50px;
  51. padding: 15px 15px;
  52. line-height: 20px;
  53. margin: -15 ;
  54. text-decoration: none;
  55. text-decoration-line: none;
  56. text-decoration-thickness: initial;
  57. text-decoration-style: initial;
  58. text-decoration-color: initial;
  59. }

My progress as a picture:
Django for Everybody CSS Autograder作业卡在尝试制作复制页面上。

答案1

得分: 1

对于链接颜色,你确实想要影响&lt;a&gt;标签而不是周围的div,所以创建一个新的样式链接:

  1. #link a, #link a:visited {
  2. color:white;
  3. text-decoration:none;
  4. }

同时使用a和a:visited,这样颜色在第一次点击链接后会变为白色。您可以从#link设置中删除颜色样式,因为它现在是多余的。

要将顶部框放置在链接以下位置,只需将它们的top值设置为50px,而不是5px,例如:

  1. #two {
  2. /*正确*/
  3. position: fixed;
  4. width: 25%;
  5. top: 50px;
  6. }
英文:

For the link colour, you are really wanting to affect the &lt;a&gt; tag rather than the surrounding div, so make a new style link:

  1. #link a, #link a:visited {
  2. color:white;
  3. text-decoration:none;
  4. }

Use both a and a:visited so the color is white the first time and after you have clicked the link. You can remove the color style from the #link set as it is now redundant.

To place the top boxes lower than the link, simply make their top values 50px rather than 5, eg

  1. #two {
  2. /*correct*/
  3. position: fixed;
  4. width: 25%;
  5. top: 50px;

huangapple
  • 本文由 发表于 2023年5月11日 01:22:10
  • 转载请务必保留本文链接:https://go.coder-hub.com/76221098.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定