- This topic is empty.
Viewing 11 posts - 1 through 11 (of 11 total)
Viewing 11 posts - 1 through 11 (of 11 total)
- The forum ‘CSS’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
that’s my website, I used svg to make the hexagons, I was wonder if there was a easy way to overlay say this image http://goo.gl/dheZNl on the home one and etc. I wanted it to look like this picture I made in photoshop. http://imgur.com/vKLlQbd
http://codepen.io/Alecar983/pen/KVGvQL
You could just set it as a background-image to the svg…
the svg is transparent so you can see the background image through it, putting the house image as the background messes it up and makes that become the background of the whole website. I’m probs doing it wrong though .
Try to add this, it sort of works :
svg {
background: url(//goo.gl/dheZNl) center;
}
Unfortunately a pseudo won’t affect an svg… but another option I can think of would be to inline the image in the svg with xlink
.
Of course masking is an alternative as well but the above would be the most cross browser solution.
using the thing you link just applied it to all of them which I didn’t want, I wanted to have individual images on each hexagon
putting the house image as the background messes it up and makes that become the background of the whole website.
That was just to show it basically does work.
I got it to work on the one svg. Thanks man. Just need to figure how to move it up a little without moving the svg
How about this?
.hexagon2 {
width: 150px;
background: url(//goo.gl/dheZNl) top center / 65% no-repeat;
}
Nope :( That makes no image come up
Edit: changed something and yeah that kind of fixes it, but the image is a little to high, but I reckon I could work with that, maybe.
You could do some trial and error to get the background size and position right. If you want the image on top, you’ll need to use the inlined xlink
approach.