Hi, Im trying to center my content in my div using margin:auto with a set width to get it out of touching the border. SITE
It is the content on the left side with the iframe and text on the bottom. im trying to put margin auto and margin top. and left as well. The iframe is just for temporary fill…
I want it to be something like this…like I did before but the same method I did for this page …like the way my content is centered in their respective divs…
The one last thing I will say is that if you are trying to center content inside of a div, generally you can just apply text-align:center; to the div and it’ll center its’ contents…
So basically I have my elements like stuck together when I use the display table method and it is also hitting the border of my wrapper and I want to center them away from each other and the border. Not sure why it is doing that.
I was able to use margin but margin auto did not seem to work on it, I know I need a set width but when I put the width it did not wok either…I have it like this:
Yes if the width is 100% then its effectively the width of hte parent, and it obviously will be unable to center itself within the child since it has no margin to work with .