ndjustin20 Posted May 15, 2008 Share Posted May 15, 2008 Can someone tell me why the following code won't center the link $msg = '<a href="http://www.gaf.com/General/GafMain.asp?Silo=RES1&WS=GAF&App=ROOF&Force=shingle-lines.asp"> <font "color="#000066" size="+3"><center>GAF-ELK Shingle Styles & Colors</center></font></a>'; Link to comment https://forums.phpfreaks.com/topic/105836-link-wont-center/ Share on other sites More sharing options...
soycharliente Posted May 16, 2008 Share Posted May 16, 2008 You need to center the link as a whole, not just the link's text. <center><a href="index.html">Home</a></center> Link to comment https://forums.phpfreaks.com/topic/105836-link-wont-center/#findComment-542884 Share on other sites More sharing options...
pquery Posted June 1, 2008 Share Posted June 1, 2008 or you could try to add: style="text-align:center;" inside your <a> tag (and maybe remove your <center></center> tags) OR if that doesn't work for all browsers slap a <div align="center> </div> around your link Link to comment https://forums.phpfreaks.com/topic/105836-link-wont-center/#findComment-554528 Share on other sites More sharing options...
TheFilmGod Posted June 1, 2008 Share Posted June 1, 2008 <div class="link"> <a href="http://www.gaf.com/General/GafMain.asp?Silo=RES1&WS=GAF&App=ROOF&Force=shingle-lines.asp">GAF-ELK Shingle Styles & Colors</a> </div> CSS: .link { text-align: center; } .link a { font-size: 16px; color: #000066; } Link to comment https://forums.phpfreaks.com/topic/105836-link-wont-center/#findComment-554589 Share on other sites More sharing options...
liamloveslearning Posted June 3, 2008 Share Posted June 3, 2008 is it in a table? you could try <td align='center'> Link to comment https://forums.phpfreaks.com/topic/105836-link-wont-center/#findComment-557003 Share on other sites More sharing options...
TheFilmGod Posted June 3, 2008 Share Posted June 3, 2008 is it in a table? you could try <td align='center'> This is a bad practice. First of all, you shouldn't be using tables. Second of all, you should use a class not inline css. Link to comment https://forums.phpfreaks.com/topic/105836-link-wont-center/#findComment-557022 Share on other sites More sharing options...
haku Posted June 4, 2008 Share Posted June 4, 2008 And to add to that, align has been deprecated. Link to comment https://forums.phpfreaks.com/topic/105836-link-wont-center/#findComment-557104 Share on other sites More sharing options...
soycharliente Posted June 4, 2008 Share Posted June 4, 2008 ...you shouldn't be using tables... Depends on the data! Link to comment https://forums.phpfreaks.com/topic/105836-link-wont-center/#findComment-557132 Share on other sites More sharing options...
TheFilmGod Posted June 4, 2008 Share Posted June 4, 2008 Depends on the data! --- V --- V --- V --- V --- V --- V --- V --- is it in a table? you could try <td align='center'> So I responded by saying that you shouldn't be using tables. Maybe it is tabular data, therefore I was mistaken, but I doubt that was the case. Link to comment https://forums.phpfreaks.com/topic/105836-link-wont-center/#findComment-557932 Share on other sites More sharing options...
pquery Posted June 12, 2008 Share Posted June 12, 2008 Plus the <center> tag is going away in HTML 5 Link to comment https://forums.phpfreaks.com/topic/105836-link-wont-center/#findComment-564350 Share on other sites More sharing options...
TheFilmGod Posted June 13, 2008 Share Posted June 13, 2008 Plus the <center> tag is going away in HTML 5 Isn't going to be an official HTML 5 release. The internet's governing body that sets up standards for online coding have stated that HTML 4.01 will be the last and final release of html. Link to comment https://forums.phpfreaks.com/topic/105836-link-wont-center/#findComment-564461 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.