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

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

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代码(不应更改):

<!DOCTYPE html>
<html>

<head>
  <title>Blocks</title>
  <!-- Do not change this file - add your CSS styling
       rules to the blocks.css file included below -->
  <link type="text/css" rel="stylesheet" href="blocks.css">
</head>

<body>
<div id="one">
Turns out you have a really fun time if you
go to work every day and focus on being
silly and funny and happy! - Hannah Murray
</div>

<div id="two">
All you need in this life is ignorance and confidence,
and then success is sure. - Mark Twain
</div>

<div id="three">
Well, if crime fighters fight crime and fire fighters
fight fire, what do freedom fighters fight? They never
mention that part to us, do they? - George Carlin
</div>

<div id="four">
Great minds discuss ideas; average minds discuss events;
small minds discuss people. - Eleanor Roosevelt
</div>

<p id="link">
<a href="https://www.dj4e.com/" target="_blank">
DJ4E
</a>
</p>
</body>
</html>

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

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

#one {
/*correct*/
  position: fixed;
  width: 25%;
  bottom: 5px;
  right: 5px;
  padding: 5px;
  margin: 5px;
  border: 5px solid blue;
}

#two {
/*correct*/
  position: fixed;
  width: 25%;
  top: 5px;
  right: 5px;
  padding: 5px;
  margin: 5px;
  border: 5px solid green;
}

#three {
    /*correct*/
  position: fixed;
  width: 25%;
  top: 5px;
  left: 5px;
  padding: 5px;
  margin: 5px;
  border: 5px solid orange;
}

#four {
    /*correct*/
  position: fixed;
  width: 25%;
  bottom: 5px;
  left: 5px;
  padding: 5px;
  margin: 5px;
  border: 5px solid yellow;
}

#link {
  position: absolute;
  top: 0;
  left: 50%;
  font-size: 1.64rem;
  background-color: #0A4B33;
  box-sizing: border-box;
  font-family: 'Roboto', Corbel, Avenir, 'Lucida Grande', 'Lucida Sans', sans-serif;
  color: white;
  height: 50px;
  padding: 15px 15px;
  line-height: 20px;
  margin: -15 ;
  text-decoration: none;
  text-decoration-line: none;
  text-decoration-thickness: initial;
  text-decoration-style: initial;
  text-decoration-color: initial;
}

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):

&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Blocks&lt;/title&gt;
&lt;!-- Do not change this file - add your CSS styling
rules to the blocks.css file included below --&gt;
&lt;link type=&quot;text/css&quot; rel=&quot;stylesheet&quot; href=&quot;blocks.css&quot;&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div id=&quot;one&quot;&gt;
Turns out you have a really fun time if you
go to work every day and focus on being
silly and funny and happy! - Hannah Murray
&lt;/div&gt;
&lt;div id=&quot;two&quot;&gt;
All you need in this life is ignorance and confidence,
and then success is sure. - Mark Twain
&lt;/div&gt;
&lt;div id=&quot;three&quot;&gt;
Well, if crime fighters fight crime and fire fighters
fight fire, what do freedom fighters fight? They never
mention that part to us, do they? - George Carlin
&lt;/div&gt;
&lt;div id=&quot;four&quot;&gt;
Great minds discuss ideas; average minds discuss events;
small minds discuss people. - Eleanor Roosevelt
&lt;/div&gt;
&lt;p id=&quot;link&quot;&gt;
&lt;a href=&quot;https://www.dj4e.com/&quot; target=&quot;_blank&quot;&gt;
DJ4E
&lt;/a&gt;
&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;

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


#one {
/*correct*/
position: fixed;
width: 25%;
bottom: 5px;
right: 5px;
padding: 5px;
margin: 5px;
border: 5px solid blue;
}
#two {
/*correct*/
position: fixed;
width: 25%;
top: 5px;
right: 5px;
padding: 5px;
margin: 5px;
border: 5px solid green;
}
#three {
/*correct*/
position: fixed;
width: 25%;
top: 5px;
left: 5px;
padding: 5px;
margin: 5px;
border: 5px solid orange;
}
#four {
/*correct*/
position: fixed;
width: 25%;
bottom: 5px;
left: 5px;
padding: 5px;
margin: 5px;
border: 5px solid yellow;
}
#link {
position: absolute;
top: 0;
left: 50%;
font-size: 1.64rem;
background-color: #0A4B33;
box-sizing: border-box;
font-family: &#39;Roboto&#39;, Corbel, Avenir, &#39;Lucida Grande&#39;, &#39;Lucida Sans&#39;, sans-serif;
color: white;
height: 50px;
padding: 15px 15px;
line-height: 20px;
margin: -15 ;
text-decoration: none;
text-decoration-line: none;
text-decoration-thickness: initial;
text-decoration-style: initial;
text-decoration-color: initial;
}

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

答案1

得分: 1

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

#link a, #link a:visited {
   color:white;
   text-decoration:none;
}

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

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

#two {
  /*正确*/
  position: fixed;
  width: 25%;
  top: 50px;
}
英文:

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:

#link a, #link a:visited {
color:white;
text-decoration:none;
}

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

#two {
/*correct*/
position: fixed;
width: 25%;
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:

确定