None None
None None

Reputation: 195

How to remove/disable styling on some bootstrap elements

I want to know if it is possible to disable styling on a specific html element.

In my case it is a input text. I cannot resize it. I went through the bootstrap css and found it has padding. I tried to use padding: none and 0 0 0 0 plus !important and it did not work.

Is possible to disable the styling for that specific item?

Upvotes: 11

Views: 42281

Answers (5)

bibs2091
bibs2091

Reputation: 61

in the 'head' of your HTML change the order of the local css file and bootstrap css, the local css should be the after the bootstrap css:

<head>

   <!-- bootstrap css is the first here -->
   <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">

    <!-- bootstrap css is the last -->
    <link rel="stylesheet" href="style.css">


</head>

now if you applied !important in your css it should work.

another solution is to apply your css inline <element style="padding:0"></element>

Upvotes: 1

Allan
Allan

Reputation: 670

As of Bootstrap 3, you'd use the list-unstyled class to achieve this.

Example:

<ul class="list-unstyled">
    <li>...</li>
</ul>

Hope this solves your problem.

Upvotes: 6

enam
enam

Reputation: 1177

Yes it is possible. You can achieve it in following way:

  • Load your own stylesheet definition after the bootstrap.css. For your case define input[type=text]{padding:0px;} must call after the bootstrap's css file(s).
  • If you want to use in-line css you can try: <input type="text" style="padding:0px" />

Hope it helps.

Upvotes: 1

user2568107
user2568107

Reputation:

Set it in the style of the element in the style attribrute if an item is there it has priority.

Also if you want to be double sure add !important as well

Upvotes: 0

Raymond
Raymond

Reputation: 44

Would Javascript be of any help to you? If so the .setAttribute native javascript function can help:

http://jsfiddle.net/nMJjS/1/

Just replace the id that I made up with the id of input element you want to change

Upvotes: -1

Related Questions