I have tried many time but I got fail, There is a purple color in background in every pages and I want to use different image on every page which will be relevant to page title.
For sites with individual header images per page I tend to set the image in <style> tags with in the page’s header, while the rest of the css remains in a common global css file.
So long as the selector is specific enough, it will override the defaults in the global css if you place the <style> after the link to the global css.
I actually use php to pull the filename from a database and put it into the head, though it could be hard-coded into each page if preferred, or use an image file name that echoes the page name to avoid a DB call.
Where i have to paste this code, because I have designed this website in wordpress. do i have to create child theme or without creating child theme this is possible.
There is also another way of doing it by setting a class on the <body> for each specific page.
Then in your CSS you can use a descendant selector to set the styles for that page.
I was going to mention using a class as an alternative method. Adding the classes and backgrounds will be fine when there are only a handful of pages, or maybe many pages, but just a handful of different backgrounds.
My method with the <style> tags lends itself more to database driven sites with very many pages, where maintaining all the classes in the css would become unmanageable.
Though limiting it to just a handful of backgrounds, no matter how many pages, will help with caching and therefore page load times.