0

Here I have created css effect for textbox. But it does not effect.

What wrong please correct.

Fiddle

css is as below:

in1
{
    border-radius: .2em;
    border: 1px solid #cccccc;

    -webkit-transition: border linear .2s, box-shadow linear .2s;
    -moz-transition: border linear .2s, box-shadow linear .2s;
    -o-transition: border linear .2s, box-shadow linear .2s;
    transition: border linear .2s, box-shadow linear .2s;
}

in1:focus
{
    border-color: rgba(1, 168, 255, 0.8);
    outline: 0;
    outline: thin dotted \9;
    -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px     rgba(82,168,236,.6);
    -moz-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6);
    box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6);
}
3
  • Fiddle is not linked correctly Commented Oct 24, 2013 at 9:21
  • Add correct fiddle link pls. Commented Oct 24, 2013 at 9:22
  • for class you mention . for id you mention # Commented Oct 24, 2013 at 9:24

4 Answers 4

4

You just need to put a full stop before your class names in your css e.g.

.in1 { }
Sign up to request clarification or add additional context in comments.

4 Comments

Thanks. But When I used same css on my local system, it does not show me same color effect as on fiddle.
Perhaps something else is overriding the style? If you inspect it using Firebug can you see the styles being applied?
May be. Firebug shows the style #text.style1. style1 is the name of the class.
That's not the name of your class in your original post though? I think you need to post more of your html/css.
2

Class selectors are prefixed with a .. Here you're just using in1 which is an element selector. This attempts to select an element named "in1" (<in1 ... />).

Simply change your selectors to:

.in1 {
    ...
}

...and:

.in1:focus {
    ...
}

Working JSFiddle demo.

You can read more about CSS selectors in the official W3 documentation available here. From the same document's Class Selector section:

E.warning - an E element whose class is "warning" (the document language specifies how class is determined).

Comments

2

without looking at your fiddle i'm guessing you're using classes.

try adding a "." to the start of your css, so: .in1

Comments

1

You must follow this, a class selector is a name preceded by a full stop (“.”) and an ID selector is a name preceded by a hash character (“#”).

instead of in1{} put .in1{}

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.