I already found a question similar but it didn’t click.
Here is my code, I want to have two backgrounds. I know how to add two backgrounds but one background image needs to be in a specific place accomplished by using divs. My code may have the most simple flaw. Please be aware I am a newbie and trying to get into web development again from what little knowledge I already knew.
<head>
<style type="text/css">
body {
<div id="currentpage">
background-image: url(bgsource/contactpage.png);
background-repeat: no-repeat;
</div>
}
#currentpage{
position: absolute;
width:auto;
height:auto;
left:424px;
top:134px;
margin-left:0px;
margin-top:0px;
}
</style>
<?php include_once("general.php"); ?>
</head>
I may want to include that I have a general.php template that loads into every page, could that also affect the background from working?
Change your code like this. Because you cannot apply html tag inside css like you where mention in your question.
And specify the
widthandheightfordivdisplaying the image. otherwise you will have a white background.