Home > Software engineering >  Form without any style
Form without any style

Time:10-22

I would like to use <form> but without any style (like width, borders etc.). I need to get same effect like <span>. I'm using Bootstrap. Is the only valid output to be set to 0 for each css style, like width:0; etc.?

CodePudding user response:

If you want to remove all the styles from an element, just do:

.element-selector {
  all: unset !important; 
}

Adding !important will not only override styles applied but also inline styles (i.e.: <img style="width: 1000px"> has a width of 1000px set in its inline style attribute)

CodePudding user response:

Try using normalize to reset/clean styles

npm i normalize.css

Tip: load the module after other libs (bootstrap)

CodePudding user response:

Browser defaults for form are already like that — no borders, margins, or padding (in other words, like an unstyled div, but not like a span, which is inline). If you're getting styles automatically applied to forms, it must be coming from somewhere in your CSS.

  • Related