Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Is there a way to change the size/width of SugarCube2's textbox?

I'm using SugarCube2's <<textbox>> macro for something like a RPG character sheet, for inputting names and such.
Ideally, I'd like to adjust the width of these boxes so I can control the look and layout of the page.

I've been googling for CSS-based solutions, and added the following to my stylesheet:

input[type="text"] {
width: 50px;
size: 20;
}

textarea {
width: 50px;
size: 20;
}

But nothing affects the size of the textbox! It remains ~300 pixels wide no matter what. Is there any known way to affect the text input styling?

Comments

  • edited October 2016
    The input element created by <<textbox>> has a default CSS min-width of 18em, which is stopping you reducing the width smaller than that. To get around this issue simple supply your own min-width value.
    .passage input[type="text"] {
    min-width: 50px;
    width: 50px;
    }
    
    note: I added .passage to your base selector so that it is specific to the passage area and won't effect any other area that text input elements may appear.
  • Ah, min-width. My constant adversary from Swing coding returns to haunt me.

    Thanks for the help, I knew there was a simple answer.
Sign In or Register to comment.