How To Set Background Image Html By Pixel
How to add together Background Image in Html
In HTML, we tin can hands add together the background Image in the Html certificate which is to exist displayed on a web page using the following unlike two methods:
- Using the Background attribute (Html Tag)
- Using an Internal Style Sheet
Using the Background attribute
Note: HTML 5 does not support the background attribute of <torso> tag, so we take to use the internal CSS selection for adding the background in the Html document.
If nosotros desire to add the groundwork paradigm in the Html document using the Background aspect so we have to follow the steps which are given below. Using these steps, we can easily view an image on a web folio:
Step 1: Firstly, we have to type the Html code in any text editor or open up the existing Html file in the text editor in which we desire to employ the background attribute.
Step ii: Now, motility the cursor inside the starting <body> tag in our Html document. And, so type the background attribute every bit shown in the following block:
Step 3: After that, we have to give the path of the epitome we want to add. And so, blazon the path of the epitome in the background attribute. If our image is stored in the same directory in which HTML file is stored then type the following path:
If our prototype is stored in whatsoever other directory then type the correct path of that image, so that the browser can read the image hands equally described in the post-obit block.
If our prototype is on the internet then we can also add the image by using URL, as given in the post-obit cake.
Stride 4: At last, we take to relieve the Html file or Html Code in the text editor.
Test it NowThe output of the above code is shown in the following screenshot:
Using Internal Way Sheet
If we desire to add the background image in the Html document using the Internal CSS then we have to follow the steps which are given below. Using these steps, we can easily view an paradigm on a web page:
Step one: Firstly, we have to blazon the Html code in whatever text editor or open the existing Html file in the text editor in which we desire to utilize the Internal CSS choice for calculation the background paradigm.
Pace two: Now, we have to place the cursor in the head tag, just after the endmost of title tag in the Html document and so define the starting and endmost tag of the <style> tag as shown in the following cake.
Stride 3: At present, nosotros accept to blazon the element body in the style tag. And, and then type the background-image property as shown in the post-obit cake:
Step 4: And, at final, nosotros have to relieve the Html code in the text editor and run the code. After execution, we will come across the paradigm specified in the html certificate as a background of the spider web folio. The following screenshot provides the output of the above Html code:
How To Set Background Image Html By Pixel,
Source: https://www.javatpoint.com/how-to-add-background-image-in-html
Posted by: smitholaxby.blogspot.com
0 Response to "How To Set Background Image Html By Pixel"
Post a Comment