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


$wall_paper = "a.jpg";

<style type="text/css">

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

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

Free Live Chat for Any Issue

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-attachment: fixed; 

Don’t Miss : PHP Automatically Stretch Background Fit Image

Also Read This ๐Ÿ‘‰   PHP upload custom file in ckeditor Example

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="">   

I hope you get an idea about how to set background image in php?.
I would like to have feedback on my 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.

Rate this post