Flexbox grow, shrink and basis

Size
2,305 Kb
Views
26,312

How do I make an flexbox grow, shrink and basis?

A quick demo to show the flex-grow, shrink and basis properties.. What is a flexbox grow, shrink and basis? How do you make a flexbox grow, shrink and basis? This script and codes were developed by Andreas Neeven on 18 September 2022, Sunday.

Flexbox grow, shrink and basis Previews

Flexbox grow, shrink and basis - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Flexbox grow, shrink and basis</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css"> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div class="container">	<div class="item item-1"><span>1</span></div>	<div class="item item-2"><span>2</span></div>	<div class="item item-3"><span>3</span></div>
</div>
</body>
</html>

Flexbox grow, shrink and basis - Script Codes CSS Codes

.container { display: -webkit-box; display: -ms-flexbox; display: flex; position: absolute; width: 800px; height: 100%; background-color: #333; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center; -webkit-box-align: center; -ms-flex-align: center; align-items: center; padding: 50px;
}
.item { display: -webkit-box; display: -ms-flexbox; display: flex; width: 100px; height: 200px; color: white; margin-right: 25px; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center; -webkit-box-align: center; -ms-flex-align: center; align-items: center;
}
.item span { font-size: 24px;
}
/* FLEX-GROW DEFAULT "0" */
/* FLEX-SHRINK DEFAULT "1" */
/* FLEX-BASIS DEFAULT "auto" */
/* FLEX DEFAULT "0 1 auto" */
.item-1 { background-color: #f1c40f; -webkit-box-flex: 1; -ms-flex-positive: 1; flex-grow: 1; /*	flex-basis: 300px;*/ -ms-flex: 1 100%; flex: 1 100%;
}
.item-2 { background-color: #9b59b6; -webkit-box-flex: 1; -ms-flex-positive: 1; flex-grow: 1; -ms-flex-negative: 3; flex-shrink: 3;
}
.item-3 { background-color: #1abc9c; -webkit-box-flex: 1; -ms-flex-positive: 1; flex-grow: 1;
}
Flexbox grow, shrink and basis - Script Codes
Flexbox grow, shrink and basis - Script Codes
Home Page Home
Developer Andreas Neeven
Username aneeven
Uploaded September 18, 2022
Rating 3
Size 2,305 Kb
Views 26,312
Do you need developer help for Flexbox grow, shrink and basis?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Andreas Neeven (aneeven) Script Codes
Create amazing marketing copy with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!