How to put background image in HTML CSS? - Learn With Riwash

Breaking

Learn With Riwash

learn with riwash learn with riwash is the personal blog/youtube channel that provide best knowledge of software development. Here we give complate trainning of techonology as will as build software. We teach you related to web developing and programming in html,javascript,php,python,c++, c#, java programming ect. It is not a complate teaching siti like W3schools but it it a blog where we give code that help you to become better programmer.

ads

Post Top Ad

Responsive Ads Here

Post Top Ad

Responsive Ads Here

Sunday, January 7, 2018

How to put background image in HTML CSS?

How to put background image in CSS?
Article by Technical Riwash
In this article I am going to teach you how you can out
background image in HTML, CSS.
Let make folder with html.
<html>
<body>
You have background image in same folder.
Here are CSS script for background image .
<style type=”text/css”>
/*this is comment*/
What is #imgbg?
If you know html and css then know what is #imgbg?
#imgbg? Is css code that define html code with id

#imgbg{
                background-image: url("topbg.jpg");
   background-position: left top;
   background-repeat: no-repeat;
   width: 500px;
   height: 400px;
}

background-image: url("topbg.jpg");
it is css script that define that for background image.
   background-position: left top;
It is for position that define left top.
   background-repeat: no-repeat;
This text for no repeat to image .
   width: 500px;
   height: 400px;
this define width and height of background image.
Now close the css text </style>
Now write html script
<div id=”imgbg>
</div>
Close html
</body>
</html>
Note :put css script in side <head> </head> tag.





No comments:

Post Top Ad

Responsive Ads Here