flemingmike Posted March 2, 2009 Share Posted March 2, 2009 brain cramp... how would i center this? <? //Advertisement////////////////////////////////////////////////////////////////////////// echo"<a href='http://www.monsterenergy.com'><img src='http://www.vgbetting.com/betting/theme/default/images/monster.gif'></a>"; //End Advertisement//////////////////////////////////////////////////////////////////////////////////////////////////////// ?> Quote Link to comment https://forums.phpfreaks.com/topic/147615-how-to-center-picture/ Share on other sites More sharing options...
TheFilmGod Posted March 3, 2009 Share Posted March 3, 2009 margin: 0 auto; However, you need to set a fixed width. Otherwise, this centering technique will not work. Quote Link to comment https://forums.phpfreaks.com/topic/147615-how-to-center-picture/#findComment-775181 Share on other sites More sharing options...
DavidCT Posted March 3, 2009 Share Posted March 3, 2009 Why not use DIV? <div align="center"> href/img stuff </div> Quote Link to comment https://forums.phpfreaks.com/topic/147615-how-to-center-picture/#findComment-775595 Share on other sites More sharing options...
haku Posted March 4, 2009 Share Posted March 4, 2009 The align attribute is deprecated and should not be used. Quote Link to comment https://forums.phpfreaks.com/topic/147615-how-to-center-picture/#findComment-775973 Share on other sites More sharing options...
racer x Posted March 4, 2009 Share Posted March 4, 2009 You could add a basic class like .center to the image. Then in CSS just put .center { text-align:center; } Or use dedicated div for the whole section. Quote Link to comment https://forums.phpfreaks.com/topic/147615-how-to-center-picture/#findComment-776015 Share on other sites More sharing options...
DavidCT Posted March 4, 2009 Share Posted March 4, 2009 Ok, then use: <div style="text-align: center"><a href="">LINK</a></div> or make a class for it in CSS like racer x said. Quote Link to comment https://forums.phpfreaks.com/topic/147615-how-to-center-picture/#findComment-776617 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.