How to set a Background image in HTML page
Program :
<html>
<style>
h2{
color: white;
font-family: Comic Sans MS;
background-image: url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiio6okknquvxl6ly2FM5bFmPAJRIHXznTz3Jvnc8ktNv4HkQZhhBBvJd4xtQpcNppQzBzcjfTsybNYIyy7oUPt_FYBzVBUFl3ub5Usl-iPWXRELSQpo8pP82IDIHes3JjPK4QQEVnYvt8/s1600/4478233-colorful-backgrounds.jpg);
}
div{
color : black;
font-size:20px;
font-family: Verdana;
}
</style>
<body>
<br />
<center>
<h2> HOW TO USE BACKGROUND IMAGE IN JAVASCRIPT <br />LIKE THIS</h2>
<style>
h2{
color: white;
font-family: Comic Sans MS;
background-image: url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiio6okknquvxl6ly2FM5bFmPAJRIHXznTz3Jvnc8ktNv4HkQZhhBBvJd4xtQpcNppQzBzcjfTsybNYIyy7oUPt_FYBzVBUFl3ub5Usl-iPWXRELSQpo8pP82IDIHes3JjPK4QQEVnYvt8/s1600/4478233-colorful-backgrounds.jpg);
}
div{
color : black;
font-size:20px;
font-family: Verdana;
}
</style>
<body>
<br />
<center>
<h2> HOW TO USE BACKGROUND IMAGE IN JAVASCRIPT <br />LIKE THIS</h2>
<div id="Answer" padding=128px 60px >
First Define Color and Font Family and then Link a image through URL
<br />
Example :
<br /> <br />h2{<br />
color: white;<br />
font-family: Comic Sans MS;<br />
background-image: url();<br />
}
<br />
</div>
<script>
</script>
</center>
</body>
</html>
First Define Color and Font Family and then Link a image through URL
<br />
Example :
<br /> <br />h2{<br />
color: white;<br />
font-family: Comic Sans MS;<br />
background-image: url();<br />
}
<br />
</div>
<script>
</script>
</center>
</body>
</html>
you can execute this code at :
Comments
Post a Comment