You need to sign in to do that
Don't have an account?
Create and Edit Lightning Components Challenge - font size
I am having trouble completing the challenge for the "Create and Edit Lightning Components" module of the "Lightning Components Basics" trail. Here is the challenge:
Create a camping component that contains a campingHeader and a campingList component.
The campingList component contains an ordered list of camping supplies that include Bug Spray, Bear Repellant, and Goat Food.
The campingHeader component contains an H1 heading style with a font size of 18 points and displays 'Camping List'.
Here is my code:
camping.cmp
<aura:component >
<c:campingHeader/>
<c:campingList/>
</aura:component>
campingHeader.cmp
<aura:component >
<H1>Camping List</H1>
</aura:component>
campingHeader.css
.THIS {
}
H1.THIS {
font-size: 18px;
}
campingList.cmp
<aura:component >
<aura:attribute name="campingSupplies" type="List" default="['Bear Repellant', 'Bug Spray', 'Goat Food']" />
</aura:component>
When I check the challenge, I get the error message:
Challenge Not yet complete... here's what's wrong:
The component is not using the correct font size.
Any help is greatly appreciated.
Create a camping component that contains a campingHeader and a campingList component.
The campingList component contains an ordered list of camping supplies that include Bug Spray, Bear Repellant, and Goat Food.
The campingHeader component contains an H1 heading style with a font size of 18 points and displays 'Camping List'.
Here is my code:
camping.cmp
<aura:component >
<c:campingHeader/>
<c:campingList/>
</aura:component>
campingHeader.cmp
<aura:component >
<H1>Camping List</H1>
</aura:component>
campingHeader.css
.THIS {
}
H1.THIS {
font-size: 18px;
}
campingList.cmp
<aura:component >
<aura:attribute name="campingSupplies" type="List" default="['Bear Repellant', 'Bug Spray', 'Goat Food']" />
</aura:component>
When I check the challenge, I get the error message:
Challenge Not yet complete... here's what's wrong:
The component is not using the correct font size.
Any help is greatly appreciated.
<aura:component >
<ol>
<li>Bear Repellant</li>
<li>Bug Spray</li>
<li>Goat Food</li>
</ol>
</aura:component>
campingHeader.css
.THIS {
}
H1.THIS {
font-size: 18pt;
}
All Answers
<aura:component >
<ol>
<li>Bear Repellant</li>
<li>Bug Spray</li>
<li>Goat Food</li>
</ol>
</aura:component>
campingHeader.css
.THIS {
}
H1.THIS {
font-size: 18pt;
}
There are many ways you measure font sizes. Points, Pixels, Ems, Percent and so on. 18pts is equal to 24px in size. Please refer to the link below for additional information on this topic.
http://www.websemantics.co.uk/resources/font_size_conversion_chart/
Hope this helps.
Bhaskar.T
Did set it to 18px the first time I submitted the answer, so perhaps there's something wrong with the answer checking mechanism that causes it to not read any new code submitted?
camping.cmp
<aura:component >
<c:campingHeader/>
<c:campingList/>
</aura:component>
campingHeader.cmp
<aura:component >
<H1>Camping List</H1>
</aura:component>
campingHeader.css
.THIS {
}
H1.THIS {
font-size: 18pt;
}
campingList.cmp
<aura:component >
<ol>
<li>Bear Repellant</li>
<li>Bug Spray</li>
<li>Goat Food</li>
</ol>
</aura:component>
Yep. Spent a lot of frustrating time troubleshooting this Challenge's issue. Kind of a jerk move for them to show you an example using "px" and then throw in the word "points" for the Challenge. I picked up on that due to my web developer background... but who else would know/notice that?
My eventual fix was to make sure that I was on the "campingHeader.cmp" tab when I hit the "STYLE" button! This will create the "campingHeader.css" file. Previously, I had been on the "camping.cmp" button when I hit the "STYLE" button and that created "camping.css". Of course, when I Preview my app, the display looks like I did everything correctly (because, technically, I did). Regardless of it looking good in the Preview though, the Challenge will not pass you if you didn't happen to build the files exactly like it wanted them built.
The reading does mention: "It limits style rules to only this component, so that you can create styles that are specific to the component, without worrying about how those styles might affect other components." Kind of throws us all off when Preview will apply the "h1" styles to the "Header" component's "h1" tags even though we set the "h1" styles in the "Camping" component's CSS file.
.THIS {
}
H1.THIS{
font-size: 18 px;
}
It's working perfectly fine.I am not sure why we need pt instead of px.
Thanks & Regards,
Madhurima.
I have tested all the solutions possible to get it to accept the style solution, but without any luck.
Some one need to fix the interpiter of this challange.
my solution is like this one:
camping.cmp
<aura:component >
<c:campingHeader/>
<c:campingList/>
</aura:component>
campingHeader.cmp
<aura:component >
<H1>Camping List</H1>
</aura:component>
campingHeader.css
.THIS {
}
H1.THIS {
font-size: 18pt;
}
campingList.cmp
<aura:component >
<ol>
<li>Bear Repellant</li>
<li>Bug Spray</li>
<li>Goat Food</li>
</ol>
</aura:component>
have also used 18px and so forth.
I am also facing the issue:
Challenge Not yet complete... here's what's wrong:
The component is not using the correct font size. Ensure that you added it to the 'Style' section of the component bundle.
campingList.cmp
<aura:component >
<ol>
<li> Bug Spray</li>
<li> Bear Repellant </li>
<li> Goat Food</li>
</ol>
</aura:component>
campingHeader.cmp
<aura:component >
<H1>camping List</H1>
</aura:component>
campingHeader.css
.THIS {
}
h1.THIS{
font-size:18pt;
}
camping.cmp
<aura:component >
<c:campingHeader />
<c:campingList />
</aura:component>
Has any one completed this module? If yes, what wrong in he above code? Thanks in advance.
I have colleagues and friends with the exact same code who's gotten the challenge validated.
I've tried various Trailhead Playgrounds, I've tried the suggested changes to the h1/H1 tag and px/pt, but it doesn't work.
H1.This{
font-size: 18px;
}
This worked for me.
The component is not using the correct font size. Ensure that you added it to the 'Style' section of the component bundle.
Open your camping.cmp component.
from pallete at the right side click on Style.
or press CTRL+SHIFT+4.
campingHeader.css will get added to your bundle.
copy
.THIS {
}
h1.THIS{
font-size:18pt;
}
Save all and check your challange.
You might have to change your locale and language settings to English for your Trailhead Playground for it to work
Also, you can use important CSS property.
H1.THIS { font-size: 18pt !important; }
The above code will perfectly work.
----
Weird Text Generator (https://www.myweirdtext.com/)
<ol>
<li> Bug Spray</li>
<li>Bear Repellant</li>
<li>Goat Food</li>
</ol>
</aura:component>
<H1> Camping List</H1>
</aura:component>
Font-size:18pt;
}
<c:campingList/>
<c:campingHeader/>
</aura:component>
नमस्कार दोस्तों आज का यह पोस्ट लिखने वाला हूं। What Is Blogs In Hindi के बारे में। दोस्तों Blogs के बारे में वैसे तो आपने पहले भी सुना होगा। परंतु यदि आपने इसके बारे में बिल्कुल भी नहीं सुना है। तो इस पोस्ट के माध्यम से आप बहुत ही आसानी से समझ जाएंगे
https://bilkulsahihai.com/what-is-blogs-in-hindi/
Hindi Droid Hindi Droid (https://hindidroid.com)
I am also running a cookinggearlab (https://cookinggearlab.com/) blog. I also want to know how I can set my blog font. this is really helpful for me.
अपने मोबाइल से Youtube Channel कैसे Delete करें? (https://toastys.in/youtube-channel-kaise-delete-kare-mobile-se/)
Instagram पर नया ID Account कैसे बनाएं? (https://toastys.in/instagram-account-kaise-banaye/)
हमारे दिए गए कुछ चुनिंदा Best Android Games (https://www.hindimelokesh.in/2022/09/the-best-android-games.html) का उपयोग कर सकते है।