- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Set how much the item will grow relative to the rest of JavaScript.
Use the flexGrow property to set how much the item will grow relative to the rest with JavaScript.
Example
You can try to run the following code to learn how to work with flexGrow property −
<!DOCTYPE html> <html> <head> <style> #box { border: 1px solid #000000; width: 250px; height: 150px; display: flex; flex-flow: row wrap; } #box div { flex-grow: 0; flex-shrink: 1; flex-basis: 20px; } </style> </head> <body> <div id = "box"> <div style = "background-color:orange;">DIV1</div> <div style = "background-color:blue;">DIV2</div> <div style = "background-color:yellow;" id="myID">DIV3</div> </div> <p>Using flexGrow property</p> <button onclick = "display()">Set</button> <script> function display() { document.getElementById("myID").style.flexGrow = "2"; } </script> </body> </html>
- Related Articles
- Set how much a flex item will grow relative to the rest of the flex items with CSS
- Set how the item will shrink relative to the rest with JavaScript?
- How to set the length of the item relative to the rest with JavaScript?
- How to set the order of the flexible item, relative to the rest with JavaScript?
- Specify how much a flex item will shrink relative to the rest of the flex items with CSS
- Specify the order of a flexible item relative to the rest of the flex items inside the same container with CSS
- How to set the position of the list-item marker with JavaScript?
- How to set the list-item marker type with JavaScript?
- How to set the initial length of a flexible item with JavaScript?
- How to set an image as the list-item marker with JavaScript?
- How to set div position relative to another div in JavaScript?
- How to set when the transition effect will start with JavaScript?
- How to find the coordinates of the cursor relative to the screen with JavaScript?
- How to set the font size of a Tkinter Canvas text item?
- How to return the position of the element relative to floating objects in JavaScript?

Advertisements