aboutsummaryrefslogtreecommitdiff
path: root/files/uk/web/css/layout_cookbook/index.html
blob: 0af6191a71903fe3abd344505667195dcf9c756f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
---
title: Кулінарна книга з CSS розмітки
slug: Web/CSS/Layout_cookbook
translation_of: Web/CSS/Layout_cookbook
original_slug: Web/CSS/Розмітка_кулінарна-книга
---
<div>{{CSSRef}}</div>

<p class="summary">The CSS layout cookbook aims to bring together recipes for common layout patterns, things you might need to implement in your own sites. In addition to providing code you can use as a starting point in your projects, these recipes highlight the different ways layout specifications can be used, and the choices you can make as a developer.</p>

<div class="note">
<p><strong>Note</strong>: If you are new to CSS layout then you might first like to take a look at our <a href="/en-US/docs/Learn/CSS/CSS_layout">CSS layout learning module</a>, as this will give you the basic grounding you need to make use of the recipes here.</p>
</div>

<h2 id="The_Recipes">The Recipes</h2>

<table class="standard-table" style="height: 543px; width: 1188px;">
 <thead>
  <tr>
   <th scope="col">Recipe</th>
   <th scope="col">Description</th>
   <th scope="col">Layout Methods</th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td><a href="/en-US/docs/Web/CSS/Layout_cookbook/Media_objects">Media objects</a></td>
   <td>A two-column box with an image on one side and descriptive text on the other, e.g. a facebook post or tweet.</td>
   <td><a href="/en-US/docs/Web/CSS/CSS_Grid_Layout">CSS Grid</a>, {{cssxref("float")}} fallback, {{cssxref("fit-content")}} sizing</td>
  </tr>
  <tr>
   <td><a href="/en-US/docs/Web/CSS/Layout_cookbook/Column_layouts">Columns</a></td>
   <td>When to choose multi-column layout, flexbox or grid for your columns.</td>
   <td><a href="/en-US/docs/Web/CSS/CSS_Grid_Layout">CSS Grid</a>, <a href="/en-US/docs/Web/CSS/CSS_Columns">Multicol</a>, <a href="/en-US/docs/Web/CSS/CSS_Flexible_Box_Layout">Flexbox</a></td>
  </tr>
  <tr>
   <td><a href="/en-US/docs/Web/CSS/Layout_cookbook/Center_an_element">Center an element</a></td>
   <td>How to center an item horizontally and vertically.</td>
   <td><a href="/en-US/docs/Web/CSS/CSS_Flexible_Box_Layout">Flexbox</a>, <a href="/en-US/docs/Web/CSS/CSS_Box_Alignment">Box Alignment</a></td>
  </tr>
  <tr>
   <td><a href="/en-US/docs/Web/CSS/Layout_cookbook/Sticky_footers">Sticky footers</a></td>
   <td>Creating a footer which sits at the bottom of the container or viewport when the content is shorter. </td>
   <td><a href="/en-US/docs/Web/CSS/CSS_Grid_Layout">CSS Grid</a>, <a href="/en-US/docs/Web/CSS/CSS_Flexible_Box_Layout">Flexbox</a></td>
  </tr>
  <tr>
   <td><a href="/en-US/docs/Web/CSS/Layout_cookbook/Split_Navigation">Split navigation</a></td>
   <td>A navigation pattern where some links are visually separated from the others.</td>
   <td><a href="/en-US/docs/Web/CSS/CSS_Flexible_Box_Layout">Flexbox</a>{{cssxref("margin")}}</td>
  </tr>
  <tr>
   <td><a href="/en-US/docs/Web/CSS/Layout_cookbook/Breadcrumb_Navigation">Breadcrumb navigation</a></td>
   <td>Creating a list of links to allow the visitor to navigate back up through the page hierarchy.</td>
   <td><a href="/en-US/docs/Web/CSS/CSS_Flexible_Box_Layout">Flexbox</a></td>
  </tr>
  <tr>
   <td><a href="/en-US/docs/Web/CSS/Layout_cookbook/List_group_with_badges">List group with badges</a></td>
   <td>A list of items with a badge to display a count.</td>
   <td><a href="/en-US/docs/Web/CSS/CSS_Flexible_Box_Layout">Flexbox</a>, <a href="/en-US/docs/Web/CSS/CSS_Box_Alignment">Box Alignment</a></td>
  </tr>
  <tr>
   <td><a href="/en-US/docs/Web/CSS/Layout_cookbook/Pagination">Pagination</a></td>
   <td>Links to pages of content (such as search results).</td>
   <td><a href="/en-US/docs/Web/CSS/CSS_Flexible_Box_Layout">Flexbox</a>, <a href="/en-US/docs/Web/CSS/CSS_Box_Alignment">Box Alignment</a></td>
  </tr>
  <tr>
   <td><a href="/en-US/docs/Web/CSS/Layout_cookbook/Card">Card</a></td>
   <td>A card component, which displays in a grid of cards.</td>
   <td><a href="/en-US/docs/Web/CSS/CSS_Grid_Layout">Grid Layout</a></td>
  </tr>
  <tr>
   <td><a href="/en-US/docs/Web/CSS/Layout_cookbook/Grid_wrapper">Grid wrapper</a></td>
   <td>For aligning grid content within a central wrapper, while also allowing items to break out.</td>
   <td><a href="/en-US/docs/Web/CSS/CSS_Grid_Layout">CSS Grid</a></td>
  </tr>
 </tbody>
</table>

<h2 id="Contribute_a_Recipe">Contribute a Recipe</h2>

<p>As with all of MDN we would love you to contribute a recipe in the same format as the ones shown above. <a href="/en-US/docs/user:chrisdavidmills/Layout_Cookbook_Home/Contribute_a_recipe">See this page</a> for a template and guidelines for writing your own example.</p>