To make your background image repeat, you can use the CSS background-repeat property (in conjunction with the background-image) property. But we will teach you the one in which the image should no-repeat and it covers full screen. Your background repeat is in body::before but your background image is in body.bg1. Asking for help, clarification, or responding to other answers. In the CSS used here, we set an image as value to its attribute has name background-image. So, both have and ending tags respectively. Inherits this property from its parent element. An adverb which means "doing without understanding". Which are like background image, background repeat, height and width. The image will only be shown Home | About | Contact | TermsofUse | PrivacyPolicy, How to make a background image not repeat. The above example uses inline styles but could just as easily have used an external style sheet or an embedded style sheet (styles embedded in the document head). Thirdly, tag is used to define the webpage body. The background-image property needs to be a URL to the image. element, in the We hope that you will understand the example properly, we define this in last points also. To learn more, see our tips on writing great answers. Here is an explanation of how each option works for either direction: Formal definition Formal syntax background-repeat = <repeat-style> # After that the class is used to give CSS to body, the CSS used here is internal CSS. The first property that is background-image is used to give url of image in body, the other background-repeat is used to not repeat images continuously, after this we use height and width with 100% value, so that it covers full screen or display or browser. Also, to make sure the entire element is always covered, set the Basically you were targeting the wrong element with background-repeat: no-repeat; so instead of targeting the anchor I targeted the list items, which are the ones with the background images. But due to some reason we are unable to set image as background accurately. By clicking Post Your Answer, you agree to our terms of service, privacy policy and cookie policy. BCD tables only load in the browser with JavaScript enabled. Making statements based on opinion; back them up with references or personal experience. Use background-position to specify the position your background image appears within its container and/or background-size to specify how large the background should appear. The background-position property is used to If you want to report an error, or if you want to make a suggestion, do not hesitate to send us an e-mail: W3Schools is optimized for learning and training. The first space (no gaps). CSS Reference: The background-repeat property. and the CSS background-image property: Add a background image on a HTML element: You can also specify the background image in the