mirror of
https://github.com/phuoc-ng/csslayout.git
synced 2025-08-30 00:59:47 +02:00
feat: Split screen
This commit is contained in:
8
contents/_includes/patterns/split-screen.njk
Normal file
8
contents/_includes/patterns/split-screen.njk
Normal file
@@ -0,0 +1,8 @@
|
||||
<div class="split-screen">
|
||||
<div class="split-screen__half">
|
||||
{% circle "md" %}
|
||||
</div>
|
||||
<div class="split-screen__half">
|
||||
{% lines "hor", 10 %}
|
||||
</div>
|
||||
</div>
|
@@ -115,6 +115,7 @@ eleventyExcludeFromCollections: true
|
||||
{% pattern "Same height columns" %}{% include "patterns/same-height-columns.njk" %}{% endpattern %}
|
||||
{% pattern "Sidebar" %}{% include "patterns/sidebar.njk" %}{% endpattern %}
|
||||
{% pattern "Simple grid" %}{% include "patterns/simple-grid.njk" %}{% endpattern %}
|
||||
{% pattern "Split screen" %}{% include "patterns/split-screen.njk" %}{% endpattern %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
36
contents/split-screen.md
Normal file
36
contents/split-screen.md
Normal file
@@ -0,0 +1,36 @@
|
||||
---
|
||||
layout: layouts/post.njk
|
||||
title: Split screen
|
||||
description: Create a split screen with CSS flexbox
|
||||
keywords: css flexbox, css layout, css split screen
|
||||
---
|
||||
|
||||
## HTML
|
||||
|
||||
```html
|
||||
<div class="split-screen">
|
||||
<!-- Left content -->
|
||||
<div class="split-screen__half">
|
||||
...
|
||||
</div>
|
||||
|
||||
<!-- Right content -->
|
||||
<div class="split-screen__half">
|
||||
...
|
||||
</div>
|
||||
</div>
|
||||
```
|
||||
|
||||
## CSS
|
||||
|
||||
```css
|
||||
.split-screen {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.split-screen__half {
|
||||
flex: 1;
|
||||
}
|
||||
```
|
||||
|
||||
{% demo %}{% include "patterns/split-screen.njk" %}{% enddemo %}
|
Reference in New Issue
Block a user