Hi guys!
How are you?
So, I am trying to finish this lesson, but it is quite hard. However, it is not because the lesson… I get what I have to do: adjust the height property. It is just not working and I don’t know what I am doing wrong.
Please, help!
Thanks!
<style>
h4 {
text-align: center;
height: 25px;
}
p {
text-align: justify;
}
.links {
margin-right: 20px;
text-align: left;
}
.fullCard {
width: 245px;
border: 1px solid #ccc;
border-radius: 5px;
margin: 10px 5px;
padding: 4px;
}
.cardContent {
padding: 10px;
}
</style>
<div class="fullCard">
<div class="cardContent">
<div class="cardText">
<h4>Google</h4>
<p>Google was founded by Larry Page and Sergey Brin while they were Ph.D. students at Stanford University.</p>
</div>
<div class="cardLinks">
<a href="https://en.wikipedia.org/wiki/Larry_Page" target="_blank" class="links">Larry Page</a>
<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 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36 OPR/63.0.3368.94.
I think I have seen other people having issues with this challenge, I just can’t figure out what the problem might be. I would be curious to know if you fail on the new version of the challenge as well.
Can you try something?
Right-click the h4 and select “Inspect” from the context menu.
Switch to the console tab.
Paste the following into the console $('h4').css('height') and press enter.
What does the console log out?
If all else fails I’d suggest trying Firefox as some people have reported it to work.
Interesting, I think this might be a viewport/zoom bug.
I can see there is an issue open for this challenge. I might have a fix, but as I can’t reproduce this bug myself, it would be super helpful to get some more data. So if you are up for it I have something I’d like for you to try (or anyone else with this bug).
Same steps again but this time use window.getComputedStyle($0).height and then use $0.offsetHeight. Report what each returns.
Wait it is reporting 73? Did you set the height in the CSS? Did you remember to right-click the element and use Inspect first?
Anyway, the fact that offsetHeight is giving an integer value as expected and getComputedStyle a float (decimal number) gives me hope that the fix I have will work.