Solved

Image stay at the same place

Posted on 2014-01-13
9
186 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
  • 4
  • 3
9 Comments
 
LVL 54

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 54

Expert Comment

by:Julian Hansen
ID: 39776330
Change

background-repeat:repeat-x;

To

background-repeat:none;
0
ScreenConnect 6.0 Free Trial

Want empowering updates? You're in the right place! Discover new features in ScreenConnect 6.0, based on partner feedback, to keep you business operating smoothly and optimally (the way it should be). Explore all of the extras and enhancements for yourself!

 

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 54

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 54

Expert Comment

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

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Format results with PHP 3 75
RESTful API no sessions but track a user who doesn't have an account 2 125
JQuery tracking event. 3 66
site launch date and last modified date 3 93
Preface This article introduces an authentication and authorization system for a website.  It is understood by the author and the project contributors that there is no such thing as a "one size fits all" system.  That being said, there is a certa…
This article covers the basics of the Sass, which is a CSS extension language. You will learn about variables, mixins, and nesting.
The viewer will learn how to dynamically set the form action using jQuery.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

770 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