0

I want to use bootsrap in my asp.net 4 project.

I installed bootstrap in visual studio using nuget:

enter image description here

I have global css file:

    /*Global styles*/
body, form
{
    direction: rtl;
    font-family: Arial;
    font-size: 16px;
    color: #333333;
    margin: 0px;
    padding: 0px;
    background-position: bottom;
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-color: #f8f8f8;
}
input[Type=text], input[Type=password], input[Type=button], input[Type=submit], input[Type=reset], input[Type=file], select, textarea
{
    margin: .2em .05em;
    border: 1px solid #333333;
    color: #333333;
}
input[Type=text], input[Type=password], input[Type=file], select, textarea
{
    max-width: 225px;
    width: 98%;
}
input[Type=text]:disabled, input[Type=password]:disabled, input[Type=file]:disabled, select:disabled, textarea:disabled
{
    background-color: #E6F6FA;
}
input[Type=button], input[Type=submit], input[Type=reset]
{
    background-color: #EEEEEE;
    cursor: pointer;
}
input[Type=button]:hover, input[Type=submit]:hover, input[Type=reset]:hover
{
    background-color: #DCDCDC;
}

I need to define style of the buttons and other elements using bootstrap, I want to it in global css file.

So my question how can I use bootstrap in css file?

2 Answers 2

1

You can import the CSS file like stara_wiedzma said. However you can't import bootstrap's .btn class for input[Type=button], input[Type=submit], input[Type=reset] globally with CSS

I think you are looking for something like LESS of SASS. With LESS and SASS you can do things like:

input[type=button]{
    .btn;
    .btn-success;

    // your own styles...
}

Google: "bootstrap less workflow" for some setup and examples.

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

4 Comments

Does LESS or SASS gives me option to import bootstrap style to css page?
Yes! You can inherrit bootstrap's classes on your own elements. The example I gave will make all buttons look like bootstrap's success button.
Can please you give some example?Or write reference to example in google??
I think this: scotch.io/tutorials/getting-started-with-less will explain a lot
1

@import url("//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css");

1 Comment

where do I write it in ccs file?and how I add it to button style defenition?

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.