71853

How to add icon near text in TextArea in GWT?

Question:

I have text area with text (some help tip) and I want to add info icon before text in order it looks like:

icon ----- ---------- ---------- -----. *icon: help icon *---: help text

If it is impossible to add icon to TextArea, maybe there're any other solutions on how to do it (in a label?)?

Answer1:

You can't add an icon to the TextArea. You can show an icon on top of a TextArea in a specified location (by adding both icon and TextArea to a div and using relative positioning), but then it will obscure the text under it as users type it in.

Answer2:

You only need CSS directives :

.yourClass { background-image : url('yourImage.png'); background-repeat : no-repeat; padding-left : 30px; }

.yourClass is the CSS class to set on your TextArea.

30px corresponds to the image width to avoid the text to be positioned on it.

Recommend

  • defining typed constant numbers in C/C++
  • Pygame program that can get keyboard input with caps
  • Crystal Reports: Passing Multiline Parameter Values
  • Parent-div doesn't expand with child div
  • Create objects with ground plane detection only once with Vuforia & Unity
  • Automatically change the position of objects when using different devices
  • Position absolute not working inside position fixed
  • how to populate a SQLite database and use that database in phonegap?
  • Creating a DropDownList
  • xcode don't localize specific strings
  • How do I include a SWC in an AS2 Flash project?
  • How to add a focus style to an editable ComboBox in WPF
  • Zoom in and out of jPanel
  • Authentication in Play! and RestEasy
  • Firefox Extension - Monitor refresh and change of tab
  • How do I superscript characters in a UIButton?
  • Saving Changes After In-App Purchase Has Been Purchased
  • How to match http request and response using Jersey ContainerRequestFilter and ContainerResponseFilt
  • Swift: Switch statement fallthrough behavior
  • Change multiple background-images with jQuery
  • Python CGI os.system causing malformed header
  • Handling un-mapped Rest path
  • Algorithm for a smudge tool?
  • FileReader+canvas image loading problem
  • Paperclip, set path outside of rails root folder
  • Insert into database using onclick function
  • java.lang.NoClassDefFoundError: com.parse.Parse$Configuration$Builder on below Lollipop versions
  • Deselecting radio buttons while keeping the View Model in synch
  • Is my CUDA kernel really runs on device or is being mistekenly executed by host in emulation?
  • Why HTML5 Canvas with a larger size stretch a drawn line?
  • Can Jackson SerializationFeature be overridden per field or class?
  • script to move all files from one location to another location
  • Sending data from AppleScript to FileMaker records
  • Which linear programming package should I use for high numbers of constraints and “warm starts” [clo
  • To display the title for the current loaction in map in iphone
  • Android Studio and gradle
  • KeystoneJS: Relationships in Admin UI not updating
  • AngularJs get employee from factory
  • Load html files in TinyMce
  • Memory offsets in inline assembly