Working on a site where the images are in a column with overflow:hidden. I’m trying to find a way to have the images be cut off from the center instead of the right side — but the only way is to have the image be in the background of a div.
I’m thinking of adding something like this to the template:
<div class=”genericphotostyle” style=”background-image:url(GRAB THE IMAGE URL DYNAMICALLY) blah blah”><img=”GRAB THE IMAGE URL DYNAMICALLY” /></div>
Is there a way to grab the url dynamically, if the image name is limited to something like “postname-image”?
If so, is there a way this could work for more than one image uploaded with a post — “postname-image1”, “postname-image2”?
- The topic ‘code to pull uploaded photo into css background’ is closed to new replies.