When a project says something specific, like for example position an image in the center, should it be coded like that, can’t I code it in relative positioning.
Well, using relative positioning can allow children to be centred, it’s not either that or centre an element. I’m not sure quite what you mean here – I think you’re looking at a very specific thing and without seeing some code it’s very difficult to help.
img element should be centered within its parent element."
This is what the project is asking, and I’m not sure if I’m allowed to use relative positioning to execute it. Also do you have any suggestions on how I should position an element in the center of its parent? Thank you!
I recommend you review these lessons:
- Learn Applied Visual Design: Center an Element Horizontally Using the margin Property | freeCodeCamp.org
- Learn CSS Flexbox: Align Elements Using the justify-content Property | freeCodeCamp.org
Hope this helps
Ok thank you so much!