0

I am using input-group input-group-lg classes to add styles to textarea.

The border is not being applied to the textarea.

Default value for the border is 0. in bootstrap.css if we modify

.input-group .form-control:first-child{
    border:1;
}

Then i am getting border. How can i apply this style to my_styles.css which is in my project.

I pasted above selector in my css file and used !important also and not getting border.

Thanks in advance.

1
  • 1
    Is my_styles.css the last CSS stylesheet that is imported? (you MUST make it the last one so it overrides the Bootstrap defaults) Commented Jun 15, 2014 at 13:37

2 Answers 2

2

You defined border: 1, what 1? One apple, one meter, one pixel?

Complete border definition is border: 1px solid #000 (width type color), if you only want to change border width, use border-width: 1px;.

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

Comments

2

Do not use !important unless you really really have to.

To override the existing styles, make sure you load your CSS files after the bootstrap one. Then, make sure your rules are at least as specific as those in the original CSS file, only like that you can override them.

Here is a nice tool for comparing specificity: http://specificity.keegan.st/

Also, make sure you follow the proper syntax for each CSS rule. The example you've shown is not valid CSS therefore it should not work, ever. Look at @panther's answer for detailed explanation.

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.