The problem with your example is in the CSS application priority.
Explaining:
There are priorities for applying style rules in CSS, they are as follows, from highest to lowest priority:
Rules with !important
;
Rules within attribute style
of an element HTML
;
Rules with one or more selectors by id
;
Rules with one or more selectors by class
, atributo
or pseudo-seletor
;
Rules with one or more selectors per element;
Rules with universal selector.
These 6 priorities are applied when the rules are in the same file. If two rules of the same priority conflict, the one with the highest number of selectors wins the highest priority.
When it comes to different files, the priorities of the files are as follows, from highest to lowest priority:
Obs : From item 2, it refers to files other than the HTML page itself.
Rules within element style
in head
of HTML;
Rules inside a file imported by @import
within style
;
Rules inside a file imported by an element link
;
Rules inside a file imported by a @import
into a file imported by a link
element;
Rules inside an attached file by an end user;
Obs : If the rules are with !important
they have the highest priority.
Default CSS rules for browser .
Source="Pro CSS and HTML Design Patterns" by Michael Bowers.
I'm mentioning CSS as a female because of the translation of Creative StyleSheets
which stands for Cascading Style Sheets .
Going straight to the problem
Since you have defined something within the style
attribute of the element, it overwrites the width attribute of any class of Bootstrap
, unless width
through Bootstrap
has !important
together, something that I do not believe it happens.
One suggestion to solve the problem would be to change the measure from width
to %
. There it maintains the self-adjusting ability.