This question already has an answer here:
Making image positioned on textbox clickable in case of ipad (Creating HTML5 Search input type for iOS)
(1 answer)
Closed 9 years ago.
I have a following scenario but i dont know how to add the text followed by image and text followed by image and so on. Please refer the image below and that is an input text with values
How do i achieve this using jquery and css?
If possible show it in js fiddle
Thanks in advance
Try this:
HTML:
<input type="text" name="whatever" id="funkystyling" />
CSS:
#funkystyling {
background: white url(/path/to/icon.png) right no-repeat;
padding-right: 17px;
}
Example:
http://jsfiddle.net/markom/5Ayx7/
Related
This question already has answers here:
How to remove focus border (outline) around text/input boxes? (Chrome) [duplicate]
(11 answers)
Closed 3 years ago.
I tried to remove border from the buttons on the Gps tracking Control Panel.
The button on the click shows the blue border, so I do not want that border on the buttons, here is the picture how its looks like :
https://ibb.co/RDHGX3f
Please, can you inspect it and tell me what do I need to do, to remove that border from the buttons!
and I tried this code to insert but nothing:
.x-toolbar .x-btn {
border: none!important;
border-radius: 15px!important;
text-decoration: none!important;
}
That's an outline.
outline:none;
This question already has answers here:
How do I edit a CSS variable using JS?
(7 answers)
Closed 4 years ago.
I have got a question.
How to change font-size of :root, using javascript?
I need to make a button to resize font in a whole website.
While I have no idea what --font-size should be, accessing :root itself seems to be working with CSSStyleSheet.insertRule()
function doThing(){
document.styleSheets[0].insertRule(':root { font-size: 26px; }');
}
HelloWord<br>
<button onclick="doThing()">Clicky</button>
If you change the document.body.style.fontSize you are basically changing the :root. As long as the rest of your styles use em or rem font-sizes, all the text on the site should change accordingly.
This question already has answers here:
How to change cursor color without changing text color?
(5 answers)
Closed 8 years ago.
<textarea style="color:red;"></textarea>
I have a textarea set color red. However I want the blinking mark be black, so user can see more clear where they are typing.
Is anyway to do achieve this? Do I need to use javascript, if so, please tell me how?
try this -
textarea {
cursor: url(cursor.cur);
}
Implementing Custom Cursors
If you need a cursor that is not included by default, or not supported
across all browsers, you have the option to include a custom cursor
image. This can be defined similarly to the font-family rule, where
you provide fallbacks in case the custom cursor doesn't load.
.elementClass {
cursor: url(/cursors/cursor.png), /* Modern */
url(/cursors/cursor.cur), /* IE */
default; /* Built-in fallback */
}
More Info here and here
This question already has answers here:
Google Chrome > Textboxes > Yellow border when active..?
(2 answers)
Closed 10 years ago.
I am trying to make a form for my website and there is two problems that i am facing
the first problem is when i put an input for example :
<textarea cols:40 rows:50></textarea>
If you clicked on that in chrome the border-color will change into orange and in safari it will change into blue so how can i stop the color changing in border?
Remove the outline:
textarea {
outline: none;
}
Bear in mind, though, that the outline is used to indicate the focused form-field, which may be useful as an accessibility aid to some disabled/limited-vision users; it's always worth making an effort to replace the default visual cue with another, that fits your theme, whether by changing the color of the outline or by using background-color on the element itself.
Also your HTML is malformed, it should be:
<textarea rows="50" cols="40"></textarea>
References:
outline.
You need to remove outline on focus:
textarea:focus {
outline: none;
}
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Jquery growing and shrinking textarea
I want to achieve an effect where a text <input> will grow vertically when the text overflows. So instead of the beginning text being scrolled off, a new line starts, and the <input> grows vertically.
How could I achieve this using Javascript/jQuery/CSS/HTML/etc?
You probably can use an autogrowing textarea styled as an input - DEMO
textarea {
height: 20px;
line-height: 20px;
resize: none;
}
There are numerous plugins exists to achieve the same effect - I used this for the demo.
A pure Javascript way:
<textarea onkeyup="while(this.scrollTop > 0) {this.rows++;}"></textarea>