Which am I using, how am I setting it up?
<div class="overlay">
<img class="overlay"> or <div class="overlay">
or am I not using a class?
Which am I using, how am I setting it up?
<div class="overlay">
<img class="overlay"> or <div class="overlay">
or am I not using a class?
Do you mean that the blue image is a placeholder and you intend to use a different image once your code is working as you want?
Exactly, yes.
In my example you donāt need an overlay because its all set up properly and you can add the background image to the element called (perversely) .image.
Your current example collapses if you remove the actual image because you have not sized the div to match the parent which is controlling the overall size. In your example you would need a height to the div that was holding the image before any background would show.
Refer to my example (copy, paste and run).
You know how it gets smaller, can I have it going in this direction instead?
How the video collapses?
Updated code
You want the vid to stay in the middle of the viewport at narrow widths?
If so, that is what my code in post #43 does.
Its centred in the viewport so will always remain in the middle horizontally and vertically.
If you donāt want it centred remove the margin:autos from the wrapper and add vertical-align:top to the table cell instead of middle.
How come after I click on it thereās no picture?
I donāt know what I touched?
You told me to remove this line of code:
<img src="https://i.imgur.com/bQGFmLZ.png" ></div>
I did that and now after I click on it no picture shows.
How do I fix it?
Why did you remove the closing div? Thatās got nothing to do with the image.
That fixed it, thanks.
I have an issue, the background image doesnāt flow as it gets smaller. How do I fix it?
I want the background image to get smaller as the whole thing gets smaller. I donāt want it to stay the same size.
Hope thereās a fix I can implement for this.
When I copy the code from @PaulOBās post #59 and run that page in my browser, it resizes perfectly. If I replace the blue with a background image, as he suggested, it still works perfectly.
So I suggest you carefully compare your code to Paulās and see where youāve gone wrong.
Code
How it looks:
How it should look:
This.
.image {
background: url('https://i.imgur.com/TkyTjYF.jpg');
background-size: cover;
}
Thatās it! Thanks a lot.
If you took time to read other replies properly, youād have seen that in both Paulās original post and my own post above.
This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.