View Full Version : [CLOSED] CSS Class : How to set CSS class to TextField

Jan 22, 2015, 5:45 PM
I am trying to add a css class to text field.my code like bellow.but textfield not take effect

@using Ext.Net.MVC

Layout = null;

<!DOCTYPE html>

<meta name="viewport" content="width=device-width" />
.input {
border: 1px solid #CCCCCC;
font-size: 14px;
font-weight: bold;
width: 225px;
height: 18px;
margin-top: 2px;
padding: 5px 2px 2px;
.BlankText("Your username is required.")

<br />
<input name="txtPass" type="password" id="txtPass" tabindex="3" class="input" />

Jan 23, 2015, 10:42 AM
Hi @matrixwebtech,

Please clarify have you inspected HTML elements and its CSS rules? Usually, inspecting help to understand and determine what changes are required.

Jan 23, 2015, 3:22 PM
Thanks for tips.I override default css with same class name and !important .am I follow correct technique?

.x-form-text {
background: none !important;

Jan 23, 2015, 7:50 PM
If you want it changed for every field, then your technique applies, although I don't think !important is necessary as long as your rule is applied last. If you only want to change some fields, then specify a Cls for those fields and use CSS like
.my-custom-textfield-cls .x-form-text {
background: none;