Just starting out? Need help? Post your questions and find answers here.
orangetek
 
Posts: 7
Joined: Fri Dec 08, 2017 2:32 pm

Center placeholder text in string gadget?

by orangetek Thu Sep 26, 2019 9:08 am

Code: Select all
OpenWindow(0,0,0,200,200,"main",#PB_Window_BorderLess|#PB_Window_ScreenCentered)
TextGadget(1, 50,  20, 100, 20, "Login",#PB_Text_Center)
StringGadget(2, 50, 60, 100, 30, "Username", #PB_String_PlaceHolder)
StringGadget(3, 50, 100, 100, 30, "Password", #PB_String_Password|#PB_String_PlaceHolder)
ButtonGadget(4, 50, 140, 100, 30, "Login")


Image

Is there a way to center the placeholder text? I looked through the css file for gadgets and tried "text-align: center;" on the placeholder stuff but nothing changed.
User avatar
Peter
 
Posts: 625
Joined: Mon Feb 24, 2014 10:17 pm
Location: 127.0.0.1

Re: Center placeholder text in string gadget?

by Peter Thu Sep 26, 2019 9:30 am

Code: Select all
OpenWindow(0,0,0,200,200,"main",#PB_Window_BorderLess|#PB_Window_ScreenCentered)
TextGadget(1, 50,  20, 100, 20, "Login",#PB_Text_Center)
StringGadget(2, 50, 60, 100, 30, "Username", #PB_String_PlaceHolder)
StringGadget(3, 50, 100, 100, 30, "Password", #PB_String_Password|#PB_String_PlaceHolder)
ButtonGadget(4, 50, 140, 100, 30, "Login")

! $(".dijitPlaceHolder").css("text-align", "center")
! $(".dijitPlaceHolder").css("width", "100%")
! $(".dijitPlaceHolder").css("margin-left", "")


Image
orangetek
 
Posts: 7
Joined: Fri Dec 08, 2017 2:32 pm

Re: Center placeholder text in string gadget?

by orangetek Thu Sep 26, 2019 9:42 am

wow! that was fast and thanks
Return to Coding Questions

Who is online

Users browsing this forum: No registered users and 6 guests