Created
July 16, 2023 22:37
-
-
Save chekle/56895de79bfea13474208fb0b3d4e91b to your computer and use it in GitHub Desktop.
Background Images - Examples Using CSS & ACF
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
style="background-image:url('<?php $image = get_sub_field('image'); $size = 'full'; if( $image ) { echo wp_get_attachment_image_url( $image, $size ); } ?>');" | |
style="background-image: linear-gradient(269.77deg, rgba(0, 0, 0, 0.2) 2.1%, rgba(0, 0, 0, 0.6) 100%), url(<?php $image = get_sub_field('background_image'); $size = 'full'; if( $image ) { echo wp_get_attachment_image_url( $image, $size ); } ?>);" | |
/* Background Images CSS */ | |
background-image:url(images/image.jpg); | |
background-repeat: no-repeat; | |
background-size:cover; | |
background-position:center; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment