Style or CSS won't work - html

Here's my input from a modal form
<input class="input-medium pull-left atcCode" type="text" id="atcCode" style="text-transform : none">
When I type on the input, it is all capitalized. And when I inspect element the code, style="text-transform : none" is gone.
<input class="input-medium pull-left atcCode" type="text" id="atcCode">
I also tried in CSS but also won't work.
.atcCode{
text-transform: none;
}
Thanks.

Try using '!important' like this:
.atcCode{
text-transform: none !important;
}
Then, hit Ctrl+F5 to refresh your css.
If it doesn't work try using Ctrl+F and search for the word capitalized or text-transform in both your css and the page itself, see if it's somewhere in your css that is giving the capitalization effect. Try remove the whole class in your input tag and see if it is still capitalized. If it doesn't, then the problem lie in the two other classes and you can check the two classes specifically to see where is / are the capitalization attribute in there.
Also search for #input to see if the input tag is being given an attribute to have its text all capitalized. Some outer tags that are surrounding your input tag might be causing this as well.

In your css the mistake is to use .atcCode instead of #atcCode
The point is for classes, hashtag is for id.
text-trasform:none
is the default value
use instead
text-transform:lowercase

Related

Wrapping an HTML input button's text value over multiple lines

How do I move text to a new line in an HTML input element with the type="button" attribute?
I have following code:
<input type="button" id="btnTexWrapped" value="I see this is a long sentence here." style="width: 200px;" />
I want the button's text value to be wrapped in two lines. I tried typing it into the next line in HTML. It didn't work as I expected:
<input type="button" id="btnTexWrapped" value="I see this is a long
sentence here." style="width: 200px;" />
I also tried using all options of white-space with fixed width: 200px;, but still nothing works.
I am OK with statically fixing the length, width, or other values: as the control is not going to change.
white-space: normal;
should work
Try this, you can see how it works instantly:
<input type="button" value="Carriage
return
separators" style="text-align:center;">
You can use button tag
<button> I see this <br/>is a long <br/> sentence
here.</button>
For anyone reading this question 4 years later, I would like to add some clarifying details. Lokesh's answer is the correct one (not the accepted answer), but the initial question is based on a misunderstanding of how HTML works, which no one has addressed.
HTML is not a white-space significant language. That is, any new lines are completely ignored by the browser. While you can (and should!) put new lines in your HTML code in order to write readable, maintainable HTML, it will (almost) never affect the end result (I won't get into exceptions here).
As Lokesh indicated, you can use the <br /> tag to force a new line. Another common way is to use block level elements, such as div or section.
A number of elements are set to block by the browser UA stylesheet. They are usually container elements, like <div>, <section>, and <ul>. Also text "blocks" like <p> and <h1>. Block level elements do not sit inline but break past them. By default (without setting a width) they take up as much horizontal space as they can.
This is a quote from https://css-tricks.com/almanac/properties/d/display/, which is a very good reference on the different properties for the display attribute.
Additionally, I don't recommend trying to use any of the other suggested solutions which require putting encoded newline symbols inside the value attribute. This is pushing the input tag beyond was it was designed for. If you need more complex content for a button, the button tag is more appropriate. In fact, I generally don't think there's ever good reason to use <input type="button"> instead the button tag. It's much more semantic, easier to read, and is infinitely more flexible - for example, in allowing breaks and other elements (such as images!) inside it.
Just a bit of knowledge and a few recommendations from a professional web developer... :)
I had come cross type of requirement in my one of the project,i resolved like given below.
use html encoding string
<input button type="submit" value="This is button
two line text" />
for splitting the text in value attribute of the button tag
Hope this will help you..
Just press enter in the middle of the value, like this:
<input type="button" id="btnTexWrapped" value="I see this is a long
sentence here." style="width:200px;"/>
I

HTML Input Type?

is there any special input type in HTML that is designed to only display values, based on say, other input? When nobody is allowed to write into it. Or is a disabled text box the best option?
<input type="text" readonly />
The readonly attribute does your magic.
Nowadays its very easy to remove readonly attribute on browser. I suggested you to use label or span and write few lines of css codes for that label element to become look like input box.
<label>test value</label>
<style>
label {
padding:3px;
border:1px solid black;
width:200px;
}
</style>
use the readonly attribute, or use javascript to update the contents of a div
In HTML5 drafts, the output element exists for such purposes. I don’t think there’s much point in using it, though, since the same goal can be achieved in other ways.
In order to just display data, use any normal HTML element, like p or div or span.
If the data needs to be transmitted along the form data, put it into a hidden element, <input type=hidden>.
You can of course combine the two if needed: separately display the data and include it into the form data set.

What is a no tag line interpreted as?

I'm currently wondering when to use clean text (not wrapped inside eg. <p> tags) in html documents.
i have a input fiels which i want some text before like:
<p>Age:</p> <input type="text" name="age">
But using the p tags as above will result in a linebreak between the two. However if I leave out the p tags this problem is no more.
My question is then wether it is OK to leave out the tags, and what in is interpreted as,
Thanks
You are looking for the <label> tag
Though there are many solutions as Webarto said you can style the p tag, or you can use span or label...People usually use label..I'll tell you why..
In good web designing principles one thing comes very important..
If you have some checkbox, or radiobutton, or textfield anything in your form then it should be selected just by clicking on the label assosiated with it..User should not search for the
radiobutton and then click, as it is very small, it should be triggered just by clicking the label, user should not search for the textfield and then click inside it and then type..
<label for="id of input element"> attribute provides that function
Hence people prefer
<label>
The p element means in principle a paragraph, though HTML5 (and common practice) takes a liberal position on this: a “paragraph” is any block of text. But even under that interpretation, there is no reason to use p markup for a field label, as you do not want the label to appear in a block of its own. You might use p markup around the label and the corresponding input field, as in
<p><label for=age>Age:</label> <input type=text name=age id=age></p>
The reason is that you probably want to present such constructs as blocks, not consecutively all on one line. But then you need to remember that p markup implies default margins, corresponding to an empty line above and below. You can remove then using CSS, but a simpler and somewhat more logical approach is perhaps to use div, which indicates a block but with no default margins;
<div><label for=age>Age:</label> <input type=text name=age id=age></div>

HTML character code to underline next character

Like:
abcdef
_
What HTML character code I need to insert before b to make b underlined?
I need this inside a html attribute (value of a input field), so html tags like <u> are not acceptable
example:
<input type="submit" value="UnderlineMeifUknowHow" accesskey="n" />
I want the first "n" from UnderlineMeifUknowHow to be underlined
You can simply put ̲ after any word and it becomes underlined, its a HTML Code.
<input type=button value=S̲end>
It becomes:
S̲end
But you can create a JavaScript function to do it for you, see:
function underlineWord(pos,str){
str = str.substring(0,pos) + str[pos] + "̲" + str.substring(pos+1,str.length);
return str;
}
This way, if you execute:
underlineWord(0,"string");
You will have:
s̲tring
Try this:
abcde<br />
<span style="visibility:hidden">a</span>_
Example: http://jsfiddle.net/fXMrN/
As I tould you in the question-comments, there are special characters and I finally found it!
e̲
Poorly it depends on the font you're using to move the underline directly under the letter. It's also known as a "combining character" and can be found under U+0332 in the unicode table.
Try a<u>b</u>cdef, this should help. Read more about HTML tag u.
you could wrap b with a <span> styled with text-decoration:underline or a <u>
Use <u> tags
Please note that the <u> tags is deprecated and thus will invalidate your document. It's been deprecated because users can confuse it with a link and makes for confusions
In any case you should be using CSS for any styling
Do you mean surround b with the u tag?
<u>b</u>
To be standards compliant, I would use inline CSS:
<span style="text-decoration:underline;">b</span>
I would refer to a guide such as http://w3schools.com/html/ to get answers to quick reference questions like this.
This is not possible to do inside an attribute like you want to, and FWIW you probably shouldn't style text inside attributes anyway.
Outside attributes (i.e. using HTML elements), one could use the <u> element, but that is presentational markup and generally considered a bad idea. The best way to underline something is to use CSS (text-decoration: underline;) on whatever element you want underlined.
CSS:
<style>
.underline {
text-decoration: underline;
}
</style>
Markup:
<input style="text-decoration:underline;" type="submit" value="underlined" />

HTML/CSS - Changing properties of a text field

Is it possible to change the properties of a text field when it's selected/active (i.e. being typed in). I'd like to simply change the border colour but I haven't found a thing about actually doing it.
I tried using :active but that only works when the mouse is pressed (obviously I guess)
the selector you want is called :focus
To change the border of an input field when it's selected/active, use :focus
Example below:
HTML:
<input type="text" id="ageField" name="age" />
CSS:
#ageField:focus {
border-color: #F00;
}
Explanation / Details
# W3Schools CSS:focus Selector
You are looking for the onFocus/onBlur HTML elements. With these you can use Javascript to modify the colors/style tags.
onFocus/onBlur tutorial