You need to sign in to do that
Don't have an account?
TrailHead Lightning Challenge Help!
Help please - I am trying to complete the Lightning Challenge here:
https://developer.salesforce.com/trailhead/lightning_components/lightning_components_creating
But when I submit I am told it is wrong:
The component does not include an H1 tag with a 'headline' CSS class
My component reads:
<!-- MyLightningComponent.cmp -->
<aura:component implements="force:appHostable">
<div class="headline">
<H1>Hello Lightning Component!</H1>
</div>
</aura:component>
and I have a Style:
.THIS {
background-color: yellow;
padding-top: 10px;
}
H1.THIS {
font-size:24px;
}
.THIS H1{
font-weight: bold;
padding: 10px;
}
.THIS.headline {
padding-top: 20px;
font-size:24px;
}
.THIS .red {
background-color: red;
padding: 10px;
}
.THIS .blue {
background-color: blue;
padding: 10px;
}
.THIS .green {
background-color: green;
padding: 10px;
}
Can anyone describe what I have done wrong?
https://developer.salesforce.com/trailhead/lightning_components/lightning_components_creating
But when I submit I am told it is wrong:
The component does not include an H1 tag with a 'headline' CSS class
My component reads:
<!-- MyLightningComponent.cmp -->
<aura:component implements="force:appHostable">
<div class="headline">
<H1>Hello Lightning Component!</H1>
</div>
</aura:component>
and I have a Style:
.THIS {
background-color: yellow;
padding-top: 10px;
}
H1.THIS {
font-size:24px;
}
.THIS H1{
font-weight: bold;
padding: 10px;
}
.THIS.headline {
padding-top: 20px;
font-size:24px;
}
.THIS .red {
background-color: red;
padding: 10px;
}
.THIS .blue {
background-color: blue;
padding: 10px;
}
.THIS .green {
background-color: green;
padding: 10px;
}
Can anyone describe what I have done wrong?
Hi Andy,
Sorry for last comment. There is typo. Please find correct one here.
All Answers
I have recently completed that challenge. here is the thing which you are missing.
add following to css file
Thanks,
Himanshu
Salesforce Certified Developer | Administrator | Service Cloud Consultant
P.S. If my answer helps you to solve your problem please mark it as best answer. It will help other to find best answer.
Hi Andy,
Sorry for last comment. There is typo. Please find correct one here.
.THIS.headline. Please help!
Hi
Here is the complete code: Please try and mark this answer best if it solves your issue.
<aura:component implements="force:appHostable">
<h1 class="headline">Hello Lightning Component!</h1>
</aura:component>
CSS:
.THIS .headline
{
font-size:24px;
}
@shruthi sharma what issue are you facing ?
Please copy paste here. Refresh you page once.
The component is not using the correct CSS for the 'headline' class
And I'm using correctly it
<aura:component implements="force:appHostable">
<h1 class="headline">Hello Lightning Component!</h1>
</aura:component>
CSS:
.THIS .headline
{
font-size:24px;
}
Failed to save undefined: Issue(s) found by CSS Parser (): Unparsable text found at the end of the source '<aura:component implements="force:appHostable"> <h1 class="headline">Hello Lightning Component!</h1> </aura:component> CSS: .THIS .headline { font-size:24px; }': at line 1, column 1 in '»<aura:component implements="force:appHostable"> <h1 class="headline">Hello Lightning Component!</h1> </aura:component> CSS: .THIS .headline { font-size:24px; }' : Source
.THIS .headline
{
font-size:24px;
}
MyLightningComponent.cmp
<aura:component implements="force:appHostable">
<h1 class="headline">Hello Lightning Component!</h1>
</aura:component>
--------------------------------------------------------------------------------------------
MyLightningComponent.css
.THIS .headline
{
font-size:24px;
}
-----------------------------------------------------------------------------------------
Lightning Component Tabs named "MyLightning" is properly created.
------------------------------------------------------------------------------------------
RESULT: Challenge Not yet complete... here's what's wrong:
The component is not using the correct CSS for the 'headline' class
<aura:component implements="force:appHostable">
<div>
<H1 class="headline"> Hello Lightning Component!</H1>
</div>
</aura:component>
CSS:
.THIS H1.headline{
font-size:24px;
}
Ensure that you use captical H for the h1 tag as given above!
<aura:component implements="force:appHostable">
<div>
<H1 class="headline"> Hello Lightning Component!</H1>
</div>
</aura:component>
CSS:
.THIS.headline{
font-size:24px;
}
while i am saving ....this error coming
@Saran kumar
remove the css lines from your component code.
Please click on the Style (ctrl+shift+4) then add your CSS
Anyone have an idea what's causing this? Trailhead just won't accept my correct code!
Where CSS is added to <h1> tags as: