centering div issue
So could someone tell me where I went wrong in trying to center it ? I put a display flex on the body but it didn’t center it like it usually do with a previous project . And also when shown on my laptop it’s full width but on my phone it’s shrinked down HELP please LOL
7 Replies
Just an advice. Make simplified Codepen of this. It'll be easier for people helping you.
@MikeWill245 as far as I know, if you want to center a div, you need to use
margin: 0 auto
and your preferred width
plus add display: flex
Add it inside the body
declaration of your CSS file.We need to see your HTML as well.
@Islandstone
It's really difficult to find the issue here from a video. It's on mobile, the indentations are messy and we can't change anything to see what helps.
It would be really useful if you made a codepen (https://codepen.io) , so we can have a better look at it
CodePen
An online code editor, learning environment, and community for front-end web development using HTML, CSS and JavaScript code snippets, projects, and web applications.
we've got a channel #how-to-ask-good-questions and a post in this form #How To Ask Good Questions that give you a lot of tips on how to share your code in a usable format, please give them a look
@MikeWill245 copy your whole code to codepen and share the link, from video we cant help