Tell us what’s happening:
What am I doing wrong? I added the hr tag between h4 and p, but its still saying the hr tag should come between the title and paragraph. Thing is, it does, its under Alphabet and over the paragraph. I’m lost
Your code so far
<style>
h4 {
text-align: center;
height: 25px;
}
p {
text-align: justify;
}
.links {
text-align: left;
color: black;
}
.fullCard {
width: 245px;
border: 1px solid #ccc;
border-radius: 5px;
margin: 10px 5px;
padding: 4px;
}
.cardContent {
padding: 10px;
}
.cardText {
margin-bottom: 30px;
}
</style>
<div class="fullCard">
<div class="cardContent">
<div class="cardText">
<h4><del>Google</del>Alphabet</h4>
<hr></hr>
<em><p>Google was founded by Larry Page and Sergey Brin while they were <u>Ph.D. students</u> at <strong>Stanford University</strong>.</p></em>
</div>
<div class="cardLinks">
<a href="https://en.wikipedia.org/wiki/Larry_Page" target="_blank" class="links">Larry Page</a><br><br>
<a href="https://en.wikipedia.org/wiki/Sergey_Brin" target="_blank" class="links">Sergey Brin</a>
</div>
</div>
</div>
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36.
<h4><s>Google</s>Alphabet</h4>
<hr>
<p><em>Google was founded by Larry Page and Sergey Brin while they were <u>Ph.D. students</u> at <strong>Stanford University</strong>.</em></p>
</div>
<div class="cardLinks">
<a href="https://en.wikipedia.org/wiki/Larry_Page" target="_blank" class="links">Larry Page</a><br><br>
<a href="https://en.wikipedia.org/wiki/Sergey_Brin" target="_blank" class="links">Sergey Brin</a>
</div>
<div class="fullCard">
<div class="cardContent">
<div class="cardText">
<h4>Google Alphabet</h4>
<hr>
<em><p>Google was founded by Larry Page and Sergey Brin while they were <u>Ph.D. students</u> at <strong>Stanford University</strong>.</p></em>
</div>
<div class="cardLinks">
<a href="https://en.wikipedia.org/wiki/Larry_Page" target="_blank" class="links">Larry Page</a><br><br>
<a href="https://en.wikipedia.org/wiki/Sergey_Brin" target="_blank" class="links">Sergey Brin</a>
</div>
</div>
</div>
I had the same issue. I tried condef5’s version, which only differs in that “em” element contains the “p” element instead of vice versa. After all, these guys are human. Probably not bad practice to start switching around formatting in order to get the program to advance you to the next challenge. Programming is all about problem solving in weird ways (I would imagine. What do I know?).
this works for me
this is a challenge anyway
so gotta find a way
h4><s>Google</s>Alphabet</h4>
<hr>
<em><p>Google was founded by Larry Page and Sergey Brin while they were <u>Ph.D. students</u> at <strong>Stanford University</strong>.</p></em>
There is a bug on the site which doesn’t allow the correct answer to pass, and worse it allows invalid HTML to pass. Putting p elements inside em elements is invalid code.
The course itself seems to be OK to me, so far. I knew basic HTML & CSS before I started this course but wanted to pick up HTML5 and try and get into JavaScript. The hr issue is only an issue due to it not accepting the correct answer — most people would never have thought of using the wrong answer themselves, and it’s just a shame it’s being passed off as being OK. I’m hoping that somewhere further into the course it is explained how and why you should use validators to check your code, which would pick up any mistakes.
I had this same issue of the tag being in the right place but not being accepted. After reading these comments I thought to refresh my browser to see if that would clear the error and it worked.