You need to sign in to do that
Don't have an account?
Test User 501
Lightning Design System Grid Problem
Hi guys,
I'm just starting to use the Lightning Design System and I dont really understand the behaviour of the grid system.
As you can see, the last content has 100% width ... my understanding is that it should be 33.33% just like the other cols.
Am I missing something here?
Cheers
I'm just starting to use the Lightning Design System and I dont really understand the behaviour of the grid system.
<div class="slds-grid slds-wrap"> <aura:iteration items="{!v.fieldsFromObject}" var="field"> <div class="slds-col--padded slds-size--1-of-1 slds-small-size--1-of-1 slds-medium-size--2-of-6 slds-large-size--3-of-12"> TEST </div> </aura:iteration> </div>And thats the result:
As you can see, the last content has 100% width ... my understanding is that it should be 33.33% just like the other cols.
Am I missing something here?
Cheers
You can add padding/margin for the inputfields. You can refer this link for more information about these.
http://www.lightningdesignsystem.com/components/utilities/spacing/
Let me know if you need any thing else.
Thanks and Regards,
Sai Krishna Tavva.
All Answers
Can you post the full code to debug it .
Thanks and Regards,
Sai Krishna Tavva.
Result:
Below will work for you, you will get an idea from it what to do in the .css file of the component. There is not anything that you are missing. It is just an css issue.
Thanks,
Amit
For me it is rendering Exactly how it should work. see below screenshots.
Result:
If you Observe the highlighted line in the code the div ( Black color) is the fifth Component line before that 4 (red,blue,Yellow,Green) are present. But you have applied the slds-large-size--3-of-12 which means each block should take 33.33% of width in large screen. the remaining columns will shift to second row automatically and adjust width such that to fit the entire row in a equal spacing (As you are using slds-col-padded).
if you want to occupy the black color div width 33.33% then you have to remove the class slds-col-padded. As below.
Result:
try with adding or removing Extra div's to understand more. Also changing the size of the div tags.
Let me know if you have any quieries.
Also please mark this as best answer if this answers to your question .
Thanks and Regards,
Sai Krishna Tavva.
Thanks!
You can add padding/margin for the inputfields. You can refer this link for more information about these.
http://www.lightningdesignsystem.com/components/utilities/spacing/
Let me know if you need any thing else.
Thanks and Regards,
Sai Krishna Tavva.
Please Mark the solution as best answer if it answers to your question as it may useful to others.
Thanks and Regards,
Sai Krishna Tavva.
Thank you very much!