2016-09-22 04:13:25 +02:00
|
|
|
---
|
|
|
|
title: "Layout: Header Image Overlay"
|
|
|
|
header:
|
2016-10-10 17:48:30 +02:00
|
|
|
overlay_image: /assets/images/unsplash-image-1.jpg
|
2016-09-22 04:13:25 +02:00
|
|
|
caption: "Photo credit: [**Unsplash**](https://unsplash.com)"
|
2018-09-10 17:04:06 +02:00
|
|
|
actions:
|
|
|
|
- label: "Call to action 1"
|
|
|
|
url: "https://github.com"
|
|
|
|
- label: "Call to action 2"
|
|
|
|
url: "https://mademistakes.com"
|
2016-09-22 04:13:25 +02:00
|
|
|
categories:
|
|
|
|
- Layout
|
|
|
|
- Uncategorized
|
|
|
|
tags:
|
|
|
|
- edge case
|
|
|
|
- image
|
|
|
|
- layout
|
2017-04-04 15:12:32 +02:00
|
|
|
last_modified_at: 2016-05-02T11:39:01-04:00
|
2016-09-22 04:13:25 +02:00
|
|
|
---
|
|
|
|
|
|
|
|
This post should display a **header with an overlay image**, if the theme supports it.
|
|
|
|
|
|
|
|
Non-square images can provide some unique styling issues.
|
|
|
|
|
|
|
|
This post tests overlay header images.
|
|
|
|
|
|
|
|
## Overlay filter
|
|
|
|
|
|
|
|
You can use it by specifying the opacity (between 0 and 1) of a black overlay like so:
|
|
|
|
|
2018-09-11 15:58:22 +02:00
|
|
|
![transparent black overlay]({{ '/assets/images/mm-header-overlay-black-filter.jpg' | relative_url }})
|
2016-09-22 04:13:25 +02:00
|
|
|
|
|
|
|
```yaml
|
|
|
|
excerpt: "This post should [...]"
|
|
|
|
header:
|
2016-10-10 17:48:30 +02:00
|
|
|
overlay_image: /assets/images/unsplash-image-1.jpg
|
2016-09-22 04:13:25 +02:00
|
|
|
overlay_filter: 0.5 # same as adding an opacity of 0.5 to a black background
|
|
|
|
caption: "Photo credit: [**Unsplash**](https://unsplash.com)"
|
2018-09-10 17:04:06 +02:00
|
|
|
actions:
|
|
|
|
- label: "More Info"
|
|
|
|
url: "https://unsplash.com"
|
2016-09-22 04:13:25 +02:00
|
|
|
```
|
|
|
|
|
|
|
|
Or if you want to do more fancy things, go full rgba:
|
|
|
|
|
2018-09-11 15:58:22 +02:00
|
|
|
![transparent red overlay]({{ '/assets/images/mm-header-overlay-red-filter.jpg' | relative_url }})
|
2016-09-22 04:13:25 +02:00
|
|
|
|
|
|
|
```yaml
|
|
|
|
excerpt: "This post should [...]"
|
|
|
|
header:
|
2016-10-10 17:48:30 +02:00
|
|
|
overlay_image: /assets/images/unsplash-image-1.jpg
|
2016-09-22 04:13:25 +02:00
|
|
|
overlay_filter: rgba(255, 0, 0, 0.5)
|
|
|
|
caption: "Photo credit: [**Unsplash**](https://unsplash.com)"
|
2018-09-10 17:04:06 +02:00
|
|
|
actions:
|
|
|
|
- label: "More Info"
|
|
|
|
url: "https://unsplash.com"
|
2016-09-22 04:13:25 +02:00
|
|
|
```
|