Skip to main content

How to add a background image in css


 

The background-image property in CSS is employed to line a picture because the background of a component . Using this CSS property, we will set one or quite one background image for a component .


By default, the image is positioned at the top-left corner of a component and repeated both horizontally also as vertically. The background image should be chosen consistent with the text color. The bad combination of text and background image could also be a explanation for poorly designed and not readable webpage.


The url() value of this property allows us to incorporate a file path to any image. it'll show the element's background. we will use multiple images or a mix of gradients and pictures for the background. If the background-image is did not load or if we are using the gradients, but they're not supported on the corresponding browser then, we will use the fallback value (the value used because the substitution) because the background color of the element.


syntax:

  1. background-image: url();  


Example:
  1. <!DOCTYPE html>    
  2. <html>    
  3. <head>    
  4. <style>    
  5. body {    
  6.   background-image: url("cat.png");  
  7.   background-color: lightgray;  
  8.   }  
  9. </style>    
  10. </head>    
  11. <body>    
  12. </body>    
  13. </html>  




output:
output will be image of cat

Comments

Popular posts from this blog

Eduford HTML and CSS dynamic website template free with source code

               For more templates please subscribe the blog and share it             For more templates please subscribe the blog and share it                    For more templates please subscribe the blog and share it           For more templates please subscribe the blog and share it           For more templates please subscribe the blog and share it                                       DOWNLOAD TEMPLATE

Website background design using HTML and CSS

         Background plays a big role in website designing. When a visitor visits a website, the background works to attract him and keep him on the website.      Website background design using HTML and CSS HTML: <!DOCTYPE html> <html lang =" en "> <head> <meta charset =" UTF-8 "> <meta http-equiv =" X-UA-Compatible " content =" IE=edge "> <meta name =" viewport " content =" width=device-width, initial-scale=1.0 "> <title> animated background </title> <link rel =" stylesheet " href =" style.css "> </head> <body> <div class =" wrapper "> <h2> Animated Background </h2> <div class =" box "> <div> </div> <div> </div> <div> </div> <div> </div> ...

What is Firebase ?

Developing a booming app isn't easy to reach a broad audience; There are various devices in the world, and every device comes with a different screen size; you'll need to consider your app runs comfortably for all users using iOS, Android, and the web, and to build this application you need a backend. If you already own an application, that has lots of users Your users get logged in to your app, which means your backend will have to scale, and then after you solve your scaling problem you have to find more ways to spread the word to get fresh users. But you have to measure all these activities When you get lots of users and your app is not able to tolerate that situation, then it will crash and cause a service meltdown. This is why Firebase was developed It has all the tools that you need to build your successful app. It helps you reach new users, keep them engaged scale up to meet that demand, in addition to getting paid from beginning to being in firebase, you will have a Tes...