AgerNic.com/ro
WEB DEVELOPER SITE, HTML, CSS, PHP, SQL
Tutorial

CSS3 flex box design, Flexbox


Next Page >>
HTML images

CSS Tutorial » CSS3 flex box design

Flexbox, cunoscut în mod obi?nuit sub numele de flexbox, este un nou model de aspect introdus în CSS3 pentru a crea un aspect flexibil al interfe?ei de utilizare cu mai multe rânduri ?i coloane f?r? a utiliza valori procentuale sau de lungime fix?.

Modelul de aspect flexibil CSS3 ofer? un mecanism simplu ?i puternic pentru a gestiona aspectul spa?iului ?i alinierea con?inutului automat prin foaia de stil, f?r? a interfera cu marcajul real.

Au existat patru moduri de aspect:

  • Block, pentru sec?iunile unei pagini web
  • Inline, pentru text
  • Table, pentru datele de tabel bidimensionale
  • Positioned, pentru pozi?ia explicit? a unui element

Modulul de proiectare a cutiei flexibile faciliteaz? proiectarea unei structuri de proiectare flexibile ?i receptive f?r? a utiliza flotant sau pozi?ionare.

Sintaxa:

.flex-nume {
/ * Defini?i propriet??ile aici * /
display: -webkit-flex; / * Safari * /
display: flex; / * Sintax? standard * /
}

 

CSS3 flex box design, Flexbox

text caset? 1
text caset? 1
text caset? 2
text caset? 2
text caset? 3
text caset? 3

Suport pentru browser

Element chrome browser
 Chrome
ie browser
 IE
firefox browser
 Firefox
opera browser
 Opera
safari browser
 Safari
CSS Flexbox Yes Yes Yes Yes Yes

 

Controlul debitului în containerul flexibil

En el modelo de caja CSS estándar, los elementos normalmente se muestran en el orden en que aparecen en el marcado HTML subyacente.

El diseńo flexible le permite controlar la dirección del flujo dentro de un contenedor flexible de tal manera que los elementos se pueden colocar en cualquier dirección del flujo hacia la izquierda, hacia la derecha, hacia abajo o incluso hacia arriba.

Exemplu
<!DOCTYPE html>
<html lang="ro">
<head>
<meta charset="utf-8">
<title>Exemplu de control al debitului în containerul flexibil de-a lungul axei principale</title>
<style>
.flex-container {
width: 80%;
min-height: 300px;
margin: 0 auto;
font-size: 32px;
/* Safari */
display: -webkit-flex;
-webkit-flex-direction: row-reverse;
/* Standard syntax */
display: flex;
flex-direction: row-reverse;
border: 1px solid #666;
}
.flex-container div {
padding: 10px;
-webkit-flex: 1; /* Safari 6.1+ */
-ms-flex: 1; /* IE 10 */
flex: 1; /* Standard syntax */
}
.caja1 {
background: #e84d51;
}
.caja2 {
background: #7ed636;
}
.caja3 {
background: #2f97ff;
}
</style>
</head>
<body>
<div class="flex-container">
<div class="caja1">caja 1</div>
<div class="caja2">caja 2</div>
<div class="caja3">caja 3</div>
</div>
<p><strong>Nota:</strong> Modifica?i valoarea propriet??ii
direc?ia flex de la „rând-invers” la „rând” pentru a în?elege
cum func?ioneaz? aceast? proprietate.</p>
</body>
</html>

Fluxul de articole flexibile într-un container flexibil poate fi specificat folosind proprietatea flex-direction.

Etichete: aspect CSS3 flex box, afi?are ca css flex box, CSS Flexbox, distan?ier flex, flex basic, practic? flexbox, centru inline-flex, componente flex, flex vs bloc css, list? de articole flexbox

 

Controlul dimensiunilor elementelor flexibile

Cel mai important aspect al designului flexibil este capacitatea elementelor flexibile de a-?i modifica l??imea sau în?l?imea pentru a umple spa?iul disponibil.
Acest lucru se realizeaz? cu proprietatea flex.
Aceasta este o proprietate stenogram? a propriet??ilor flex-grow, flex-shrink ?i flex-base.

Exemple
<!DOCTYPE html>
<html lang="ro">
<head>
<meta charset="utf-8">
<title>Exemplu de control al dimensiunilor elementelor flexibile</title>
<style>
.flex-container {
width: 80%;
min-height: 300px;
margin: 0 auto;
font-size: 32px;
display: -webkit-flex; /* Safari */
display: flex; /* Standard syntax */
border: 1px solid #666;
}
.flex-container div {
padding: 10px;
}
.caja1 {
background: #e84d51;
-webkit-flex: 1; /* Safari */
flex: 1; /* Standard syntax */
}
.caja2 {
background: #7ed636;
-webkit-flex: 2; /* Safari */
flex: 2; /* Standard syntax */
}
.caja3 {
background: #2f97ff;
-webkit-flex: 1; /* Safari */
flex: 1; /* Standard syntax */
}
</style>
</head>
<body>
<div class="flex-container">
<div class="caja1">caja 1</div>
<div class="caja2">caja 2</div>
<div class="caja3">caja 3</div>
</div>
<p><strong>Nota:</strong> Experimenta?i cu valoarea propriet??ii
flexibil pentru un articol individual flexibil pentru a în?elege cum este calculat
dimensiunea elementelor flexibile.</p>
</body>
</html>

În exemplul de mai sus, primul ?i al treilea element flex vor ocupa 1/4, adic? 1 / (1 + 1 + 2) din spa?iul liber fiecare, în timp ce al doilea element flexibil va ocupa 1/2, care este, 2 / (1 + 1 + 2) de spa?iu liber.

 

Elemente simple Flexbox

Pentru a începe s? utiliza?i modelul Flexbox, trebuie mai întâi s? defini?i un container flex.

Ejemplo

<!DOCTYPE html>
<html>
<head>
<style>
.flex-container {
display: flex;
background-color: DodgerBlue;
}

.flex-container > div {
background-color: #f1f1f1;
margin: 10px;
padding: 20px;
font-size: 30px;
}
</style>
</head>
<body>

<div class="flex-container">
<div>Caja 1</div>
<div>Caja 2</div>
<div>Caja 3</div>
</div>

<p>Un design flexibil ar trebui s? aib? un element principal cu
proprietatea <em> afi?are </em> setat? la <em>flex</em>.</p>

<p>Los elementos secundarios directos del contenedor flexible se
convierten automáticamente en elementos flexibles.</p>

</body>
</html>

 

CSS3 flexbox layout

flex basic

display as css flexbox

Tags: CSS3 flexbox layout, display as css flexbox, CSS Flexbox, flex spacer, flex basic, flexbox practice, center inline-flex, flex components, flex vs block css, flexbox list of items,

Online Editor
ONLINE EDITOR

news templates


COLOR PICKER

news templates
This tool makes it easy to create, adjust, and experiment with custom colors for the web.


HTML Templates
news templates
Magnews2 is a modern and creative free magazine and news website template that will help you kick off your online project in style.


CSS HTML Layout
news templates
Find here examples of creative and unique website layouts.


Free CSS HTML Menu
news templates
Find here examples of creative and unique website CSS HTML menu.


Online Editor
ONLINE EDITOR

news templates


COLOR PICKER

news templates
This tool makes it easy to create, adjust, and experiment with custom colors for the web.


HTML Templates
news templates
Magnews2 is a modern and creative free magazine and news website template that will help you kick off your online project in style.


CSS HTML Layout
news templates
Find here examples of creative and unique website layouts.


Free CSS HTML Menu
news templates
Find here examples of creative and unique website CSS HTML menu.


analytics piwika