I want to centre two buttons horizontally on my choir webpage - with maybe 100 pixels between.
[ Join Us ] [ Book Us ]
I have limited knowledge in markup and I have limited ability to edit the pages - because of the web subscription I have with the site provider. They provide area within the body but I can't access the CSS sheets. (not that I am very skilled in that area either)
I have two images to use for the buttons which I want to link to two other pages at the site.
My page is responsive and I want the buttons to adjust as necessary to monitor or phone.
I've tried using style but when I look at it in Safari - they end up underneath each other.
I just can't seem to do it - can anyone help?
Floating won't center them though. Yeah, show us what you've got.
Thanks for your help.
- I tried using the code you suggested - If ended up left aligned though.
Here's the code..
___________________________________
<style type="text/css">IMG.displayed { display: block; margin-left: auto; margin-right: auto }
</style>
<h1 class="rtecenter"><img alt="" src="https://wososi.org.nz/sites/wososi.org.nz/files/banner/2018%20Sliders.jpg" style="width: 100%;" /></h1>
<p> </p>
<p><span style="font-size:18px;">WOSOSI... a dynamic, a cappella choir who bring the world’s rich singing traditions to you. Singing songs and chants from around the world, they convey each song’s intention and wairua - whether a quiet longing for your homeland, celebrating the joy of independence won, the despair of loved ones lost or the delicate beauty of a song of peace.</span></p>
<!-- these are the stacked ones I added because I couldn't put on same line -->
<p><a href="bookusform"><img alt="" class="displayed"
src="https://wososi.org.nz/sites/wososi.org.nz/files/banner/Book%20Us%20Button.png" style="max-width: 250px; min-width: 160px; width: 100%; border: 0;" /></a></p>
<p><a href="joinus"><img alt="" class="displayed" src="https://wososi.org.nz/sites/wososi.org.nz/files/banner/Join%20Us%20Button.png" style="max-width: 250px; min-width: 160px; width: 100%; border: 0" /></a></p>
<!-- This is the code I put based on your suggestion -->
<div style="text-align: center;"><a href="join-us.html" style="margin-right: 100px; border: 0;"><img alt="Join Us" src="https://wososi.org.nz/sites/wososi.org.nz/files/banner/buttonjoinus.png" /></a> <a href="join-us.html" style="border: 0;"> <img alt="Book Us" src="https://wososi.org.nz/sites/wososi.org.nz/files/banner/buttonbookus.png" style="margin-right: 100px;" /> </a></div>
<p> </p>
Remove the single line of CSS that you have.
I commented the markup and CSS the OP posted, not what you suggested. The images are classed. No use to keep a CSS rule that isn't needed. The classes can of course be removed too if they aren't going to be used for something else.
I removed all code other than the two buttons.
The page is here
https://wososi.org.nz/test
As you can see - it's still left aligning on the page. Do you think there may some backend css styling that the div code you have suggested won't override?
This is what I added....links work, just the buttons position is wrong
[code]
<p> </p>
<div style="text-align: center;"><a href="joinus" style="margin-right: 100px; border: 0;"><img alt="Join Us" src="https://wososi.org.nz/sites/wososi.org.nz/files/banner/buttonjoinus.png" /> </a> <a href="bookusform" style="border: 0;"> <img alt="Book Us" src="https://wososi.org.nz/sites/wososi.org.nz/files/banner/buttonbookus.png" /> </a></div>
Or maybe edit the style sheet or this problem will occur throughout the site. It's backwards to make all images block and have to style images that shouldn't be block differently. The other way around is better, to have a special rule for images that should be block.
This can be solved using the following CSS:
#container { text-align: center;}
button {display: inline-block;}
Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)