Solved

Image stay at the same place

Posted on 2014-01-13
9
189 Views
Last Modified: 2014-01-14
How the background image stay at the same place when user scroll the page up and down and also move it halfway down the page and tiling it horizontally by using css?

Thanks

<html>
<head>
<ttle></title>
<style type = "text/css">
body
{
background-image:url('MyPicture.png');
background-repeat:no-repeat;
} 
</style>
</head>
<body>
</body>
</html>

Open in new window

0
Comment
Question by:mustish1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
9 Comments
 
LVL 57

Expert Comment

by:Julian Hansen
ID: 39776292
Have you tried this
<html>
<head>
<ttle></title>
<style type = "text/css">
body
{
background-image:url('MyPicture.png');
background-position:center;
background-repeat:repeat-x;
background-attachment:fixed;

} 
</style>
</head>
<body>
</body>
</html>
                                  

Open in new window

0
 

Author Comment

by:mustish1
ID: 39776297
its showing a bunch of images. Is there any way it shows only one

Thanks
0
 
LVL 57

Expert Comment

by:Julian Hansen
ID: 39776330
Change

background-repeat:repeat-x;

To

background-repeat:none;
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:mustish1
ID: 39778142
The code fill it up the whole page with the image.

<html>
<head>
<ttle></title>
<style type = "text/css">
body
{
background-image:url('mypic.png');
background-position:center;
background-repeat:none; 
background-attachment:fixed;

} 
</style>
</head>
<body>
</body>
</html>

Open in new window

0
 
LVL 57

Accepted Solution

by:
Julian Hansen earned 500 total points
ID: 39778506
Apologies - should be no-repeat not none.
Try this
<html>
<head>
<ttle></title>
<style type = "text/css">
body
{
background-image:url('mypic.png');
background-position:center;
background-repeat:no-repeat; 
background-attachment:fixed;

} 
</style>
</head>
<body>
</body>
</html>

Open in new window

0
 

Author Closing Comment

by:mustish1
ID: 39778542
Thanks
0
 
LVL 57

Expert Comment

by:Julian Hansen
ID: 39778604
You are welcome - thanks for the points.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Most of the sites are being standardized with W3C Web Standards. W3C provides lot of web standard services to the web. They have the web specification, process and documentation for all the web standards. You can apply HTML, CSS and Accessibility st…
JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question