I tried that earlier, however not a good solution, as the gap may change and that would regenerating an image.
Main Topics
Browse All TopicsI want to repeat an image at particular intervals along the x axis.
For example , right now I have it this way an html div element with a class tickmark as follows
.tickmark
{
height: 10px;
width: 315px;
position: absolute;
top: 65px;
left:225px;
background: url(img/tickmark.png) repeat-x;
}
This repeats the image,but there is no distance between two consecutive images. I want it to be repeated at regular intervals , say 10px apart or some specific value. Can this be done using CSS? or do I need to write code(using JavaScript) to repeat the image at specific intervlas. I am sure its something very simple which I am overlooking. Awaiting expert suggestions :)
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
I have a slider control and I want to add tickmarks to it. I figured I could just have a tickmark image and have it repeat at regular intervals, depending on the slider value offset. As this offset might change , the tickmark intervals could also change. Thats why I dont want to include the interval in the image itself. Any better solution for this??
If it's just the offset you want to change, then CSS can do it.
For instance if you want to shift your bg-images 5px to the right:
background-position: 5px 0;
If you want to change the spacing between your tickmarks, then you'll need to use different images, as already mentioned.
If you want an automatic way to specify your interval, then you can create the image dynamically... using PHP for instance (PHP has all the necessary graphics libraries to do that).
For instance you can have "tickmark.php?10" return a 10px-wide tickmark image and have "tickmark.php?15" return a 15px-wide tickmark image.
Note that Yahoo! has a nice slider (under BSD license): http://developer.yahoo.com
Business Accounts
Answer for Membership
by: cLFlaVAPosted on 2006-08-01 at 09:32:18ID: 17225432
this should not be done using javascript. instead, add a 10 pixel gap in the image itself.