Any idea why the label and the progress bar from the cyan rectangle are not inline? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

Any idea why the label and the progress bar from the cyan rectangle are not inline?

I added at the end of css display inline and position relatove to both elements but it foesn't seem to work. Help. https://code.sololearn.com/Wu8ZcXRQ6tSQ/?ref=app

14th Nov 2020, 4:30 PM
๐Ÿ‡ Alex Tuศ™inean ๐Ÿ’œ
๐Ÿ‡ Alex Tuศ™inean ๐Ÿ’œ - avatar
2 Answers
+ 6
๐Ÿ’œ Purpura S ๐Ÿ‡ The CSS Grid is causing the issue with the immediate descendants. .chart { display: grid; } <div class="chart"> <label/><progress/> </div> That seems to force the grid on the immediate child elements to take precedence over the inline styles. Remove or change the display:grid for .chart and see it work. ---- Alternative: ---- You could also just wrap your label and progress tags in a div so those aren't the immediate descendants. <div class="chart"> <div> <label/><progress/> </div> </div>
14th Nov 2020, 4:53 PM
David Carroll
David Carroll - avatar
+ 3
Ah, I get it now. I got some issues with the grid. I think I will add another div to see what happens if I wrap those tags.
14th Nov 2020, 5:20 PM
๐Ÿ‡ Alex Tuศ™inean ๐Ÿ’œ
๐Ÿ‡ Alex Tuศ™inean ๐Ÿ’œ - avatar