Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

react jsx style with calc

If you need some more specific CSS you need to put it into quotes - react inline styles doc

<div style={{width: 'calc(100% - 276px)'}}></div>
In your exact case

customFormat = 'hello-div'
divStyle = {width: 'calc(100% - 276px)'}
return (
    <div className={customFormat} style={divStyle}>
      Hello World
    </div>
)
In case you need to overwrite multiple widths (fallbacks) for browser compatibility

divStyle = {width: 'calc(100% - 276px)',
    fallbacks: [
        { width: '-moz-calc(100% - 276px)' },
        { width: '-webkit-calc(100% - 276px)' },
        { width: '-o-calc(100% - 276px)' }
]}
Comment

PREVIOUS NEXT
Code Example
Javascript :: video play on page load 
Javascript :: Set node environment through package.json script 
Javascript :: set checkbox checked jquery 
Javascript :: jquery add html to end of div 
Javascript :: tagname js 
Javascript :: // Write a function that takes two strings (a and b) as arguments // If a contains b, append b to the beginning of a // If not, append it to the end // Return the concatenation 
Javascript :: Read only directories in node 
Javascript :: jquery confirm delete massege 
Javascript :: jest mongoose multiple connections 
Javascript :: align text in js 
Javascript :: Sorting an array of objects on both ascending and descending order on same click 
Javascript :: Convert underscore strings to camel Case 
Javascript :: javascript disable context menu 
Javascript :: vue call function every x seconds 
Javascript :: moving a item fro index to another index, javascript 
Javascript :: js ask before close 
Javascript :: start peerjs server 
Javascript :: index.js vs main.js 
Javascript :: save in json file js 
Javascript :: javascript toggle value 
Javascript :: jquery ajax delete 
Javascript :: javascript append to paragraph 
Javascript :: javascript unique array of objects by property 
Javascript :: pdf dark 
Javascript :: valid phone number regex with country code 
Javascript :: js compare 2 arrays for unique values 
Javascript :: js string find regex 
Javascript :: javascript find smallest number in an array 
Javascript :: js computed style 
Javascript :: how to concurrently run angular and node 
ADD CONTENT
Topic
Content
Source link
Name
5+1 =