-1

I have this situation (see img) where I got a fixed sidebar with a fixed width: 250px Now I want the content to have a full width minus the 250px But when ever I use calc(100% - 250px), I get -150% as a result in the browser.

enter image description here

see my code below

    .content {
  position: relative;
  left: 250px;
  width: calc(100% - 250px);
  width: -moz-calc(100% - 250px);
  width: -webkit-calc(100% - 250px);
  height: 100%;
  overflow-y: auto;
}

.sidebar {
  position: fixed;
  width: 250px;
  background-color: @primary_color;
  height: 100%;
  z-index: 998;
}

edit: the code was in less, so thats why my end brackets where missing

G-Cyrillus
  • 101,410
  • 14
  • 105
  • 129
Wahid
  • 51
  • 3
  • 11

1 Answers1

1

You need to escape the value of your rule else LESS compiles it.

It would be here :

 width: ~"calc(100% - 250px)";

https://github.com/SomMeri/less4j/wiki/Less-Language-Escaping

G-Cyrillus
  • 101,410
  • 14
  • 105
  • 129