FixedBackground

In this example below you will see how to do a FixedBackground with some HTML / CSS and Javascript

Thumbnail
This awesome code was written by -_-Nina-_-, you can see more from this user in the personal repository.
You can find the original code on Codepen.io
Copyright -_-Nina-_- ©
  • HTML
  • CSS
<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">
  <title>FixedBackground</title>
  
  
  
      <link rel="stylesheet" href="css/style.css">

  
</head>

<body>

  <head> 
<title> Fixed Background Image</title> 
</head> 
<body> 

<h3>A Fixed Background Image</h3> 
<h4 class="subtitle">Lady White Snake</h4>
<p> <span class="special">The old tales of China tell us that all things may grow and change. A stone may become a plant. A plant may become an animal. An animal may become a human. A human may become a god.
Just so, a snake may become a woman. And we are told of one who did.
Who can say for sure how it began? Yet after centuries of ceaseless effort—meditating, disciplining herself, mastering the energies of the universe—this white snake took human form. Immortal now and with great powers, she longed for one thing more.
Human love.
</span></p>
  <p align="center"><span class="special"> ***
  <br>
  <p> <span class="special"><span class="dropcap">P</span> 

    <p> <span class="special">erhaps no spot in China is more lovely than the famed West Lake. Lying beside the city of Hangzhou, bordered by green hills, it is often compared to a painter’s landscape or a fabled beauty. Visitors from far and near stroll the banks and take boats across the water.
</span></p>
    
    <p> <span class="special">Among the strollers on one spring day was a lovely young lady dressed in white and her young maid in blue—or so they seemed. How could anyone know they were really a white snake and a blue snake in human form? Flying on clouds from their home on sacred Mount Emei, they had come to Hangzhou to sample the joys of the human world.
</span></p>
  
    <p> <span class="special">“It’s even more beautiful than I’d hoped,” said Lady White as they walked along. “Can you smell the peach blossoms? And look, Blue! Here’s the famous Broken Bridge.”
</span></p>
    
    <p> <span class="special">“But the bridge isn’t broken!” said Blue.
</span></p>
    
    <p> <span class="special">“That’s just what it’s called,” said Lady White, smiling. “Oh, sister, I’m so glad we came here from our cold and dreary mountain.”
</span></p>
    
    <p> <span class="special">As the sun passed behind dark clouds, they spotted a young man with an umbrella under his arm. “How handsome he is!” said Blue, and Lady White agreed. Her heart felt something she had never known before.
</span></p>
    
    <p> <span class="special">Just then it began to rain, and they took shelter under a willow. The young man, whose name was Xu Xian, noticed their predicament. “Ladies,” he said, “that willow won’t keep you dry! Please use my umbrella.”
</span></p>

    <p> <span class="special">“But, sir, you need it yourself,” said Lady White.
</span></p>
    
    <p> <span class="special">“Don’t worry about me,” he said. “Look, there’s a boat coming to shore. Let me hire the boatman to take us back to the city.”
</span></p>
    
    <p> <span class="special">As they crossed the lake, the ladies insisted that the young man sit close to share the umbrella. He and Lady White exchanged shy glances and spoke awkwardly, while Blue helped the conversation along and smiled in amused delight.
</span></p>
    
    <p> <span class="special">Before long, the boat reached the landing the ladies had asked for. By then the rain had stopped, but Blue pointed secretly skyward, and it started once again.
</span></p>
    
    <p> <span class="special">Just as hoped, the young man said, “Please, you must take the umbrella home with you. I’ll come for it tomorrow.”
</span></p>
    
    <p> <span class="special">“Thank you, sir,” said Lady White. “We will expect you. Please do not disappoint us!”
</span></p>
    
    <p> <span class="special">The next morning, Xu Xian visited the house where the ladies were staying. As Blue served tea and then wine, the young man told Lady White he was an orphan and had been returning from a visit to his mother’s grave when he met them. He lived with his sister and her husband and worked as an assistant in a shop for herbal medicine.
</span></p>
    
    <p> <span class="special">Pleased by his words and his manner, Lady White whispered to Blue and left the room. Blue said, “My mistress wants to know if you would like to marry her.”
</span></p>
    
    <p> <span class="special">In surprise, the young man said, “There’s nothing I’d like better! But with the little I earn, how could I support the three of us?”
</span></p>
    
    <p> <span class="special">“Oh, don’t worry about that,” said Blue. “My mistress has an inheritance from her father. Anyway, today is lucky, so you really should get married right away. You can tell your sister later, and that umbrella will do just fine as a gift for the bride. I’ll go ahead and light the candles.”
</span></p>
    
    <p> <span class="special">Almost before he knew it, Xu Xian was standing next to Lady White in her bridal gown. They bowed to Heaven and Earth, to their ancestors, and to each other. They were now husband and wife!
</span></p>
    
    <p align="center"> <span class="special">***
</span></p>
    <p> <span class="special"><span class="dropcap">T</span> 
    <p> <span class="special">he newly weds decided to move to the city of Zhenjiang and open an herb shop of their own. The shop was a great success, for Lady White could tell just what was wrong with a patient and just what compound to prescribe. What’s more, she showed great dedication in helping the sick, no matter how poor.
</span></p>
    
    <p> <span class="special">The two were supremely happy with their work and with each other. Adding to their joy, Lady White soon announced she was expecting a child.
</span></p>
    
    <p> <span class="special">One day when Lady White had gone off to rest, an old Buddhist monk entered the shop and spoke to Xu Xian. “I am Fahai, the abbot of Gold Mountain Temple,” he said. “I have come to warn you of a great danger. By my spiritual powers, I have discovered that your wife is a thousand-year-old snake. She hides her true nature for now, but one day she will surely turn on you and devour you.”
</span></p>
    
    <p> <span class="special">“How dare you say that!” said the young man. “It’s nothing but wicked slander!”
</span></p>
    
    <p> <span class="special">But Fahai told him, “Just make sure she drinks realgar wine for the Dragon Boat Festival. She’ll change back then to her true form, and you’ll see for yourself.”
</span></p>
    
    <p> <span class="special">Soon came the Dragon Boat Festival, when everyone drank wine mixed with foul-smelling realgar to drive away snakes. Knowing the danger to her kind, Lady White stayed in bed pretending to be ill. But Xu Xian called her out of the bedroom and said cheerily, “We mustn’t let the festival pass without sharing at least one cup of realgar wine!”
</span></p>
    
    <p> <span class="special">When his wife made excuses, he suddenly remembered Fahai’s warning and mentioned it as a joke. Lady White was horrified at this unexpected assault on their happiness. Afraid then to make her husband suspicious, and hoping by her powers to withstand the realgar, she drank one cup and then another.
</span></p>
    
    <p> <span class="special">Before she could drink a third, she began to retch. She quickly returned to the bedroom, while Xu Xian hurried out to prepare her some medicine. But when he came back with it, he found on the bed not his lovely wife but a huge white snake.
</span></p>
    
    <p> <span class="special">The young man collapsed to the floor, where Blue found him moments later. “Sister,” she called, “wake up! Your husband has died of shock!”
</span></p>
    
    <p> <span class="special">Lady White, again in human form, knelt by her husband and wept. Then she declared, “I will fly to Kunlun Mountain and steal a miracle mushroom from the gods. That and nothing else can bring him back to life.”
</span></p>
    
    <p> <span class="special">Taking both her own sword and Blue’s, Lady White flew swiftly on a cloud all the way to holy Kunlun Mountain. But just as she came upon one of the miracle mushrooms, she was challenged by Brown Deer, a guard serving the gods. “I beg you,” said Lady White, “spare one mushroom to save my husband’s life.”
</span></p>
    
    <p> <span class="special">“These mushrooms are not for mortals!” said Brown Deer.
</span></p>
    
    <p> <span class="special">He struck at her with his sword, but she met it with her own. “Then forgive me if I take one anyway,” she said. And she fought back until she wounded him.
</span></p>
    
    <p> <span class="special">Lady White picked the mushroom and turned to flee. But just then White Crane, another guard, joined the fight. Holding the mushroom in her mouth, and a sword in each hand, Lady White defended herself bravely. But she was no match for both guards together and was finally beaten to the ground.
</span></p>
    
    <p> <span class="special">As White Crane raised his sword for a final blow, the Old Man of the South appeared and called a halt. “How dare you steal from us!” the god demanded of Lady White. But he could not help admiring her devotion to her husband. For that and the child she was expecting, he pardoned her and let her take the mushroom away.
</span></p>
    
    <p align="center"> <span class="special">***
</span></p>
    
    <p> <span class="special"><span class="dropcap">W</span>
      <p> <span class="special">ith a drink made from the miracle mushroom, Lady White brought her husband back to life. But though he soon recovered fully, neither one of them would speak of what had happened. Terrified by what he had seen, and not knowing of his wife’s efforts to save him, Xu Xian now did his best to avoid her.
</span></p>
    
    <p> <span class="special">Lady White, anxious to regain his love, at last played a trick on him. She changed her white silk sash into a living snake and fooled him into thinking that this was the snake that had frightened him.
</span></p>
    
    <p> <span class="special">Happiness returned to the household. But not long after, Xu Xian set off for Gold Mountain Temple to offer thanks to Buddha for his recovery. On the bank of the Yangzi River, he found Fahai waiting for him. “Your wife has tricked you,” said Fahai, and he told him just what had happened.
</span></p>
    
    <p> <span class="special">Terrified once more, the young man asked, “How can I save myself?”
</span></p>
    
    <p> <span class="special">“Become a monk and live at the temple,” said Fahai. “That’s the one place she can’t reach you.”
</span></p>
    
    <p> <span class="special">But Xu Xian, torn between love of his wife and fear of her, could not decide. “I stand in two boats at once!” he moaned. At last, meaning to decide later, he boarded Fahai’s raft and crossed with him to the river island where the temple stood.
</span></p>
    
    <p> <span class="special">Once inside Gold Mountain Temple, Xu Xian was not allowed to leave. Meanwhile, Lady White waited anxiously without news for three days. Then she and Blue took their swords and rowed a boat to the island to bring him home.
</span></p>
    
    <p> <span class="special">Fahai was waiting for them at the temple gate. Blue cried, “Give him back, you shaven-headed donkey!” But Lady White silenced her. Patiently appealing to Fahai’s compassion and sense of justice, she pleaded with him to return her husband.
</span></p>
    
    <p> <span class="special">“Demon!” cried Fahai. “My duty is to protect unsuspecting humans from such as you!”
</span></p>
    
    <p> <span class="special">“I have harmed no one and helped many,” protested Lady White. “Surely the demon is he who divides man and wife!”
</span></p>
    
    <p> <span class="special">“Sister,” declared Blue, “we must crush this temple!”
</span></p>
    
    <p> <span class="special">Fahai called down an army of heavenly warriors, while from the river below, Lady White and Blue called up an army of water animals. The two armies fought fiercely, and led by Lady White, her side was winning. But at last her condition made her falter. With her allies around her for protection, she hastily retreated.
</span></p>
    
    <p> <span class="special">Lady White and Blue fled to Hangzhou, where they found themselves once more by Broken Bridge. Believing her husband had betrayed her, Lady White said, “The bridge may not be broken, but my heart is.”
</span></p>
    
    <p> <span class="special">Blue told her, “If I ever see that traitor again, I’ll kill him!”
</span></p>
    
    <p> <span class="special">Just then, Xu Xian himself arrived. From within the temple, he had heard the noise of battle and learned it was his wife who had come for him. Determined at last to stand by her, he had managed to escape, then had searched till he found them.
</span></p>
    
    <p> <span class="special">But Blue, furious at sight of him, chased him with her sword. Lady White stood between them to protect her husband, but then turned on him herself and declared how he had hurt her. The young man protested, “Fahai kept me prisoner—yet all that time I only thought of you!”
</span></p>
    
    <p> <span class="special">“Dear husband,” said Lady White, “set aside your fear and hear me now.” Then, ignoring Blue’s signals of alarm, she revealed everything—what she was in truth and all she had done for him. “And now,” she said, “your heart must tell you what is right or wrong.”
</span></p>
    
    <p> <span class="special">Xu Xian replied, “Finally I realize all you’ve suffered for my sake. Human or not, I’ll love you always. If I don’t, let Blue cut off my head!”
</span></p>
    
    <p align="center"> <span class="special">***
</span></p>
    
    <p> <span class="special"><span class="dropcap">U</span> 
    <p> <span class="special">nited once more, the three stayed in Hangzhou with the sister of Xu Xian, and there Lady White gave birth to her baby boy. But the couple’s happiness was not to last. Just one month after their son’s birth—on the day they were to present him to friends and relatives—Fahai arrived, his golden alms bowl carried by a heavenly warrior. Lady White was instantly held captive by the bowl’s golden ray.
</span></p>
    
    <p> <span class="special">Blue attacked the warrior with her sword, but he fought her off with Fahai’s dragon staff. “Sister, save yourself,” called Lady White, “and come back later to avenge us!” Helpless for the moment, Blue fled.
</span></p>
    
    <p> <span class="special">Xu Xian pleaded with Fahai and tried to seize the bowl, but to no avail. “Now at last,” he said, “I see who is the real demon!”
</span></p>
    
    <p> <span class="special">Realizing there was no hope, Lady White said goodbye to her husband and to her baby. Then she told Fahai, “Though you tear me from my husband’s arms, you cannot stop our love.”
</span></p>
    
    <p> <span class="special">Then Fahai ordered the warrior to imprison her under Thunder Peak Pagoda by West Lake. He declared, “Not until the lake dries up or the pagoda falls will she come out again!”
</span></p>
    
    <p align="center"> <span class="special">***
</span></p>
    
    <p> <span class="special">Centuries passed. Xu Xian and Fahai passed away, but Blue did not forget. On Mount Emei, she trained herself until her powers were at their height. Then she gathered an army of mountain animals and marched on Thunder Peak Pagoda.
</span></p>
    
    <p> <span class="special">The pagoda’s guardian spirit met her with his own army, but it was defeated and forced to flee. Then Blue’s army set fire to the pagoda, which quickly crumbled.
</span></p>
    
    <p> <span class="special">“Sister, come out!” called Blue.
</span></p>
    
    <p> <span class="special">And there from the ruins rose Lady White—free again at last!
</span></p>
    
    <p align="center"> <span class="special">***
</span></p>
    
    <p> <span class="special">So ends the legend of Lady White. Who can say for sure what happened then? Perhaps she returned to Mount Emei, never more to brave the human world. Perhaps she flew above the clouds to live in peace in Heaven. Or perhaps she strolls beside West Lake along with sister Blue, waiting for her heart to stir again.
</span></p>
    
</body>
  
  

</body>

</html>

/*Downloaded from https://www.codeseek.co/-_-Nina-_-/fixedbackground-XeXevg */
body {
	width:900px;
	background-image: url("https://photos-2.dropbox.com/t/2/AADcEinRYxHyM3TXyJll-UGPHS-kMtI488MaHfHugoda0Q/12/699187057/jpeg/32x32/1/_/1/2/YEUHS.jpg/EIS_nuEFGBMgBygH/xs-JEhDt6joFdtZVzvbZ6rFtTcv49pc1CL9-Ue0C5Rw?size=2048x1536&size_mode=3");
	background-attachment: fixed;
	background-repeat:no-repeat;
	background-position:center center;
	margin: 0 auto;
	border:1.2em;
	border-style: ridge; 
	padding:1.5em;
	border-color:#ccddff;
	line-height:2em;
	}
	
h3 {
	color:#880000;
	text-decoration:overline;
	padding:.5em;
	font-style:italic;
	}
	
.subtitle {
	color:#880000;
	letter-spacing:.5em;
	text-align:center;
	font-size:2.5em;
	font-family:harrington;
}

.dropcap {
	color:#880000;
	float: left;
	width: .94em;
	font-size: 4.5em;
	line-height: 70px;
	margin-left:15px;
  
	font-family:harrington;
} 
	
.spread {
	letter-spacing:.7em;
}

.special {
	color:#880000;
}

p:first-letter { 
	font-size:200%;
	color:#880000;
	font-family:harrington;
}

Comments