Notice: The Monaca & Onsen UI Community Forum is shutting down.
For Onsen UI bug reports, feature requests and questions, please use the Onsen UI GitHub issues page. For help with Monaca, please contact Monaca Support Team.
Thank you to all our community for your contributions to the forum. We look forward to hearing from you in the new communication channels.
ons-input font-size or width
-
Hi,
is there any way we can change the ons-input font-size or width?thanks.
-
You can change
ons-input
with any other selector, like id or classes:ons-input input { width: 300px; font-size: 22px; }
-
Thanks a lot, Fran.
for width: 300px, it did work.But for font-size: 22px, even i change to font-size: 100px, the font still doesn’t change at all except the input height has changed.
is there something i missed?
Thanks.
-
@paul It does change for me. Try to put
!important
in the CSS to make sure other rules don’t overwrite it (or use some more specific rules like using IDs or classes). If you need to modify the height, then just addheight
rule as well.
-
I would like to have a input with size 100% without modify CSS
(If row contain only one input : automatically input width is 100% )
-
@Houssem You don’t have to modify the core CSS files themselves, but if you add a
style
tag block and specify the appropriate tag, you can make that happen. The following code modifies all inputs:<style> ons-input { width:100% !important; } </style>
Just put this in the
head
section of your index.html.