For my website, how do I keep everything center
For my website, how do I keep my words and pictures center
bramley
body {
text-align: center;
}
should work for text and images. If you're styling other elements, I'm pretty sure it's
body {
align: center;
}
but I'm not entirely sure.
ShoryaMalani
@bramley oops did not see your post before posting mine. that is correct though.
ShoryaMalani
Add
body{
text-align:center;
}
to css. that should work
glitchish
I'm pretty sure there is a tag made for centering:
hope that helps @ShoryaMalani[deleted]
@Programmer567 center tag is removed from HTML5
Use:
<div align="center"> <element>only text</element> </div>
dfnk
body {
text-align: center;
}
Hi Nianp! Looks like your problem got solved. If not use:
If that doesn't work than use (This centers both horizontally and vertically):
If that doesn't work than try this (this centers only horizontally):
Hope this helps! I've also noticed other people have said to use the
tag. Don't use this as it's deprecated and most browsers will remove support soon.@johno1566 Thanks so much that really helped!
@nianp no problem! you can mark this answer as correct if you want to!