Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

react background image opacity

// Basic idea is to create a outer and inner div. 
// Header(outer div) will hold an image, while content(inner) 
//will have a opacity
const styles = {
  header: {
    backgroundImage: `url(${background})`,
    height: '100vh',
    backgroundPosition: 'center',
    backgroundRepeat: 'no-repeat',
    backgroundSize: 'cover'
  },

  content: {
    height: '100%',
    width: '100%',
    backgroundColor: 'rgba(0, 0, 0, 0.5)',
  }
}

<div style={styles.header}>
  <div style={styles.content}>
     Portfolio
  </div>
</div>
Comment

PREVIOUS NEXT
Code Example
Javascript :: count word and space in text javascript 
Javascript :: how to debug jest test vscode 
Javascript :: javascript import class from another file 
Javascript :: html form post json example 
Javascript :: js get random from array 
Javascript :: javascript early break reduce() method 
Javascript :: js order string 
Javascript :: how to get dropdown selected value in javascript onchange 
Javascript :: jquery empty 
Javascript :: i18n react get current language 
Javascript :: insert new object values 
Javascript :: chartjs Uncaught ReferenceError: Utils is not defined 
Javascript :: create an attribute for html with javascript 
Javascript :: createelement with id javascript 
Javascript :: datetime to date moment 
Javascript :: readystate in ajax 
Javascript :: ityped react 
Javascript :: how to launch several async functions in node js 
Javascript :: javascript simulate click on element 
Javascript :: convert string number with commas decimal to number javascript 
Javascript :: react js multiple import 
Javascript :: javascript calculate time 
Javascript :: js pass object property as a function parameter 
Javascript :: jquery table each rows with class 
Javascript :: lodash empty string 
Javascript :: importing json file in javascript 
Javascript :: settimeout in javascript 
Javascript :: check if string contains lowercase javascript 
Javascript :: app.use public 
Javascript :: stop interval js 
ADD CONTENT
Topic
Content
Source link
Name
6+6 =