BrotherBill Posted September 14, 2007 Share Posted September 14, 2007 Hard to say. I'm just looking at what you gave us.That was how I straightened it out on mine. Link to comment Share on other sites More sharing options...
Guest zxsky1 Posted September 20, 2007 Share Posted September 20, 2007 I think you have not understood how to center an element.For an inline element, such as <img>, you should define the style of its parent element: <div class="imgBox"><img src="test.jpg" width="200px" height="100px" alt="test" /></div>div.imgBox{[b]text-align:center;[/b]} For a block element, such as <table>, you should define the style of itself: <table class="center">.......</table>table.center{width:300px;/*It should be less than its parent*/ [b]margin:0 auto;[/b]} However, you could change an inline element into a block element. Then, you can define its style as a block element. <div class="imgBox"><img class="center" src="test.jpg" width="200px" height="100px" alt="test" /></div>img.center{display:block;margin:0 auto;/*Its width should be less than its parent*/ } You can have a try. 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