clinjar89 Posted August 12, 2012 Share Posted August 12, 2012 Hello, I am very new to coding and I am struggling with getting a button centered on my homepage for a wordpress website. Here is the code for the button, any suggestions as to how I can center it? I have tried: <div style="text-align:center"> <br/> <?php echo thanks_button('Thanks', true); ?> </div> <br/> Thanks! Link to comment https://forums.phpfreaks.com/topic/266963-help-with-centering-a-button/ Share on other sites More sharing options...
maxudaskin Posted August 12, 2012 Share Posted August 12, 2012 Why are you using a function to echo a thank you button? <div style="text-align:center;"> <input type="button" value="Thank You!" /> </div> Link to comment https://forums.phpfreaks.com/topic/266963-help-with-centering-a-button/#findComment-1368711 Share on other sites More sharing options...
clinjar89 Posted August 12, 2012 Author Share Posted August 12, 2012 This is because the button is part of a wordpress plugin that counts the number of clicks and allows me to change the styling and size easily. Do you have any other suggestions without changing that? Thanks! Link to comment https://forums.phpfreaks.com/topic/266963-help-with-centering-a-button/#findComment-1368773 Share on other sites More sharing options...
Christian F. Posted August 12, 2012 Share Posted August 12, 2012 Look at the resulting HTML code, and then add the correct CSS rules to the button. I assume that it has either an ID or a class, or its parent element(s) have some identifying features. That's all you need to figure out, before you can style it to your heart's content. Link to comment https://forums.phpfreaks.com/topic/266963-help-with-centering-a-button/#findComment-1368815 Share on other sites More sharing options...
maxudaskin Posted August 15, 2012 Share Posted August 15, 2012 That's purely an HTML and CSS question... erm... statement. Link to comment https://forums.phpfreaks.com/topic/266963-help-with-centering-a-button/#findComment-1369500 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.