How to reposition an image with a linear gradient using css?

MrZooSuit

I'm trying to centre an image with a linear gradient. But the image either disappears or the gradient shifts.

I've tried using float: left; putting the image in a div container in an Html file then adding a gradient but if I do that the gradient doesn't show.

   width:750px;

   height: 1300px;

   background: linear-gradient(to top,black,transparent 30%), url(/images/ian-dooley-iD5aVJFCXJg-unsplash-750x1300.jpg) no-repeat;

I hope to be able to centre or move around my image on my website while maintaining the gradient overlay.

Any help would be appreciated

STBox
background-position: 0px 0px;
background-image: linear-gradient(to bottom, 
    #FFFFFF 0px,     /* Have one solid white area */
    #FFFFFF 255px,   /* at the top (255px high). */
    #C4C7C9 255px,   /* Then begin the gradient at 255px */
    #FFFFFF 100%     /* and end it at 100% (= body's height). */
);

Also see the link, this will surely help you http://jsfiddle.net/ExpertSystem/yyvT3/

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How to combine Background Image + Linear Gradient in CSS ? Linear Gradient over the Background Image

Animating Linear Gradient using CSS

How to create semi transparent linear gradient background and border using css?

How to half darken an image using gradient CSS?

CSS - Linear gradient transparency on both side of image

Linear gradient across an image with transparency in CSS

SwiftUI - How to add foreground linear gradient on image

Background image created in css using linear-gradient & ::before ::after does not expand with webpage

Gradient colour with Linear Gradient Border in text using css not working

How to do equivalent of a linear-gradient with opacity on a seamless background image in CSS

CSS3: How do I make a linear gradient on top of an image suitable for cross browser compatibility?

Linear Gradient to an Image in Nativescript

How to create linear gradient using SCSS variables?

How to set multi-color border using border-image and linear-gradient?

CSS Linear gradient is inaccurate?

CSS linear gradient with separations

CSS - Change background image without affecting linear gradient?

CSS Background Image Linear Gradient showing unwanted border in Chrome

Reposition correctly using only CSS?

Setting background-image (linear gradient) using jquery variables

Using custom material theme with linear gradient CSS in angular

background screen splits when using linear gradient css html

Divide html Div in to 12 Column using linear-gradient CSS

Generate solid colors using CSS linear-gradient (not smooth colors)

swift split css linear-gradient using regex

Button with background gradient and image using html and css

How to reposition the responsive navigation in css

How to put url(image) inside -ms-linear-gradient

How could I apply a linear-gradient to an element in css?