Hi ! I’m trying to insert a background image behind the heading" Aviation…" there. Now I’m un two minds, I don’t know if the “backgroung image…” should be in the INDEX or in the CSS or both.After reading the Cheatsheet again I 've tried many times but nothing changed and I’m a bit confused now. Could you help me ?
BTW: can I create a
for each part of my webpage ? should I ?
thanks a bunch in advance !
If you add the background-image as an inline-style (which is what you tried to do when adding the css style background-image:url (“your-image-path”) to the html tag) you need to wrap that in a style attribute, like:
There are several syntax errors, one has been already in my answer:
The quote marks inside the parenthesis need to be single quote marks if the quote marks around the style definition are double quote marks (I corrected that in the above post)
There is no space between the class and the style attributes
Thanks! this time it worked! It does not show the complete image , only the upper part, but maybe this is connected to sth I haven’t learned yet.
Thanks for helping me this time.
If you haven’t styled the background-image in css yet, it will spread within the container where it is applied (div.header) with the size of the image. If the image is smaller than the div, it will be repeated – if the image is larger than the div, it will be cut.
So in CSS you will have to apply several background-styles like:
Sorry Its me again. Just out od curiosity: whenever I insert an image in the Index file ( vieo, photo, audio) , should I always repeat the url in the CSS as you told me to do with the background image?
thks a bunch!
I don’t know what you mean with standard images. Maybe what I meant with content images?
And it’s a little different with videos as you can’t insert a video as a background-video as you can with background-images. There is no background-video-attribute. So you would usually insert videos in html with the <video> tag.