cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
josuecarames
Community Participant

calc(% - px)

Jump to solution

Is it possible to use the following js function in pages? 

 

 

width: calc(100% - 10px)

 

 

If not, is there any other alternative? I find myself very limited while creating responsive pages in Canvas. Any advice that does not include third-party tools? I just rather hard code everything needed myself. 

Thank you!

Labels (1)
0 Kudos
1 Solution

Accepted Solutions
MitchellGuihot
Community Member

Hi Josue,

This is valid CSS that can be used withn Canvas pages.

You can place this within a style tag on your element and it should work fine.

Below is an example:

<div style="width: calc(100% - 10px); height: 400px; background: blue;">Some Content</div>

This will make this div 10 pixels smaller than its parent.

View solution in original post

1 Reply
MitchellGuihot
Community Member

Hi Josue,

This is valid CSS that can be used withn Canvas pages.

You can place this within a style tag on your element and it should work fine.

Below is an example:

<div style="width: calc(100% - 10px); height: 400px; background: blue;">Some Content</div>

This will make this div 10 pixels smaller than its parent.

View solution in original post