how to set background image in php?

how to set background image in php? – CSS background-image property setting the background image and other CSS.

how to set background image in php

Here’s an example using background images for both the form and its wrapper: Very simple just there two types to add background images to forms in PHP

with inline css & with internal css using class properties.

background images to forms in PHP

index.php

<?php
$wall_paper = "a.jpg";
?>

<html>
<head>
<style type="text/css">

body {
background-image: url('<?php echo $wall_paper;?>');
}
</style>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Welcome To Pakainfo.com</title>
</head>
<body>
</body>
</html>

how to add background image in php code

adding background image css
how to set background image in php?

body {
 background-image: url("dp-banner.gif");
 background-color: #cccccc;
}

Set multiple background images for the body element:

body {
  background-image: url("banner.gif"), url("logo.gif");
  background-color: #cccccc;
}

CSS Code
Add the Background image using background attribute

.form-wrapper { 
  background-image:  url("logo.jpg"); 
  background-size: cover; 
  background-repeat: no-repeat; 
  background-position:fixed 
  background-attachment: fixed; 
} 

Don’t Miss : PHP Automatically Stretch Background Fit Image

Read Also:  laravel flash message Notification in Blade template

How to add Background Image in Html?

<Body background=" ">   
<Body background="filename.extension">  
<Body background="logo.jpg"> <br>  
<Body background="/home/sumit/Desktop/images/logo.jpg">   
<Body background="https://www.pakainfo.com/-update/media/2021/admin-pakainfo_v1/s1600/Blog_welcome.jpg">   

I hope you get an idea about how to set background image in php?.
I would like to have feedback on my infinityknow.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.