madtvo Posted June 3, 2006 Share Posted June 3, 2006 Is there a code that i can put into my external style sheet so all my images on my site are centered??thanks in advance Link to comment Share on other sites More sharing options...
snowboard01 Posted June 3, 2006 Share Posted June 3, 2006 first: put all of you images in div tags like this <div class="divimagealignment"><img src="http://www.somesite.com/images/someimage.gif" alt="this is an image!" /></div> Now add this to your style sheet div.divimagealignment{text-align:center;} Link to comment Share on other sites More sharing options...
madtvo Posted June 3, 2006 Author Share Posted June 3, 2006 ok, thanks man! Link to comment Share on other sites More sharing options...
snowboard01 Posted June 3, 2006 Share Posted June 3, 2006 Your welcome I'm glad I can help Link to comment Share on other sites More sharing options...
gawain Posted June 6, 2006 Share Posted June 6, 2006 Can I add one more question? What about if I want the image to appear in the middle of the page? DO I have to change the css, by usingbody {backround: #mycolor url('myimage.gif') center fixed no-repeat;or is there another way out?Thanks to anybody who can help me. Link to comment Share on other sites More sharing options...
reportingsjr Posted June 6, 2006 Share Posted June 6, 2006 you want to center the background image? I think it automatically does that when you have on no-repeat.And if you want every image center just do this: img { text-align: center; } If you do that then all of them will automatically be center. If you want it to be say, right aligned, just do this: <img src="url" style="text-align:right;"> Link to comment Share on other sites More sharing options...
scott100 Posted June 6, 2006 Share Posted June 6, 2006 Can I add one more question? What about if I want the image to appear in the middle of the page? DO I have to change the css, by usingbody {backround: #mycolor url('myimage.gif') center fixed no-repeat;or is there another way out?Thanks to anybody who can help me. <{POST_SNAPBACK}> That looks correct: http://www.w3schools.com/css/tryit.asp?fil...ycss_background Link to comment Share on other sites More sharing options...
gawain Posted June 6, 2006 Share Posted June 6, 2006 I'm not persecuting you Scott; it was my mistake that I wrote the same question two times.Sorry for that and thanks for your help 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