Changing the Height Of a WebButton in Xojo Web 2

Jeannot Muller
Jan 1 · 2 min read

This will be a quick one. Let’s create a simple WebProject in Xojo Web 2 and add a WebButton:

Image for post
Image for post
Look of the button in the Xojo IDE

This will give you the following result in your browser:

Image for post
Image for post
Button in your browser (Safari in this case)

So far so good, now let’s change the height of the button in the Xojo IDE to 150 px:

Image for post
Image for post
The new size is showing up in the IDE

The IDE is at least showing the new height, the button is not redrawn, but we know that the IDE doesn’t always reflect all changes. So how does this look in our browser?

Image for post
Image for post

Sadly the changes are not reflected in the Web application. Changes in the style element don’t help either, as the height properties (and others related) are inherited by the general XojoButton parameters, which are not accessible through the style element.

Let’s go to our up settings section:

Image for post
Image for post

Put the following CSS Code into the HTML Header section. The <style></style> tags are important, as they are telling Xojo that what is written inside is CSS code:

<style>
.btn-group { height: 100%!important; width: auto!important; } .XojoButton { text-align: center!important; }
</style>
Image for post
Image for post
How the HTML Header has to look in the Xojo IDE.

Now let’s run our example again, et voilà, it is working:

Image for post
Image for post

Learn Xojo

Everything About Developing with Xojo.com

Jeannot Muller

Written by

Managing director at teccompanion.com, physician, founder, developer and blogger.

Learn Xojo

Code snippets, tips and tricks to develop like a pro with the fantastic xojo.com tool on Windows, macOS, iOS, Web and Linux

Jeannot Muller

Written by

Managing director at teccompanion.com, physician, founder, developer and blogger.

Learn Xojo

Code snippets, tips and tricks to develop like a pro with the fantastic xojo.com tool on Windows, macOS, iOS, Web and Linux

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store