Using a grid was challenging since I had not practiced using a CSS grid in the last 3 months. I kept making mistakes in the template-columns and padding which made the img longer than the description.
abdulllah butt
@Abdullahbutt3434All comments
- @akibiaonsSubmitted almost 2 years ago@Abdullahbutt3434Posted almost 2 years ago
Hi @akibiaons, š, good job on completing this challenge! š. The navbar looks very nice in your solution. I have a suggestion that might be helpful for you. you can use one div as a wrapper around your img tag, give it width and height, and set the width and height of your image auto or 100%. that will help you to resize or adjust images according to the challenge.
Marked as helpful0 - @koloyyeeSubmitted almost 2 years ago
I am doing this challenge in vanilla css, look forward to advice if you guys have any, thanks!
@Abdullahbutt3434Posted almost 2 years agoHi @koloyyee, š, good job on completing this challenge! š I have a suggestion that might be helpful for you. you can use one more div as a wrapper around your article div and give it display flex with some CSS properties to put your complete content in the center as mentioned in the challenge Try this CSS with HTML like this:
HTML Code
<main> <article> your code ...... </article> </main>
CSS Code
main{ display: flex; justify-content: center; align-items: center; flex-direction: column; width: 100%; height: 100vh; }
you can try this.
1 - @5erious5amSubmitted about 2 years ago
Any advice is appreciated. Help a brother grow!
@Abdullahbutt3434Posted about 2 years agoHi @samuel, š, good job on completing this challenge! š I have a suggestion that might be helpful for you. you can use one class instead of id to data from all of these inputs using JS.
Your code:
<fieldset class="labels"> <input type="radio" name="rate" id="rate1" data="1"> <input type="radio" name="rate" id="rate2" data="2"> <input type="radio" name="rate" id="rate3" data="3"> <input type="radio" name="rate" id="rate4" data="4"> <input type="radio" name="rate" id="rate5" data="5"> </fieldset>
After changes
<fieldset class="labels"> <input type="radio" name="rate" class="ratingData" data="1"> <input type="radio" name="rate" class="ratingData" data="2"> <input type="radio" name="rate" class="ratingData" data="3"> <input type="radio" name="rate" class="ratingData" data="4"> <input type="radio" name="rate" class="ratingData" data="5"> </fieldset>
After this change, you can get data attributes with just a few lines of javascript code. const rating = document.querySelectorAll('.ratingData');
Marked as helpful0