Tura Posted December 28, 2005 Share Posted December 28, 2005 Is there a way to center all the images on a page using CSS? I mean sort of like changing the font of page. If there isn't a way to do that, is there a way to just center everything on a page?... I mean using CSS because the HTML uses end tags, but I can't add things to the bottom fo the page. Link to comment Share on other sites More sharing options...
boen_robot Posted December 28, 2005 Share Posted December 28, 2005 To center something you use "margin: 0 auto; ". If you want to center only all images(the center point is considered to be the center of their containg element, not the center of the page)you would do img {margin: 0 auto;} and for absolutely everything body {margin: 0 auto;} Link to comment Share on other sites More sharing options...
Tura Posted December 28, 2005 Author Share Posted December 28, 2005 Ok. And would that work for centering images in a table? Link to comment Share on other sites More sharing options...
aspnetguy Posted December 28, 2005 Share Posted December 28, 2005 That would work for evey image on the page.If for some reason it doesn't try td img {margin: 0 auto;} Link to comment Share on other sites More sharing options...
MarkAbrams Posted January 7, 2006 Share Posted January 7, 2006 The code closest to the tag or object will rule. You can center a table on the page and then through cell properties or css: left, cent or right justify the content of the cell. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now