-5

I have 2 Divs. They are both floating left and div1 has a variable.

@div1: 8%;

The HTML is:

<div class="div1">Icon</div>
<div class="div2">Big Text</div>

Can I tell the div2 that it has to use the rest of the width? So, in this case that should be 92%. How can I do this without creating a second variable? The 2 divs together have to be 100% wide.

Danny van Holten
  • 868
  • 4
  • 21
Shimakuro
  • 304
  • 1
  • 2
  • 10

1 Answers1

2

In all seriousness, it would've been faster for you to either try or read the starters manual than to ask this question.

@div1: 8%;
.selector {
    width: 100% - @div1; //Evaluates to 92%
}
Etheryte
  • 22,936
  • 11
  • 65
  • 109
  • Thanks! I have problems to understand somethings in the documentation. At last i tryed "width: calc(100% - @div1);" and it works! But your version looks clearer than my. Thanks again for this nice answer! – Shimakuro Apr 21 '15 at 21:16