LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-31-2010, 07:29 AM   #1
Completely Clueless
Member
 
Registered: Mar 2008
Location: Marbella, Spain
Distribution: Many and various...
Posts: 899

Rep: Reputation: 70
Question Quick Query to Web Developers


Hi guys,

A quick question:

What is the code snippet required to get an image to repeat vertically up a page? I can only find info relating to repeating *background* images in my search attempts, and this is just a regular image file which I want to repeat over the pre-existing page background. I'd like it to repeat all the way up the extreme left hand edge of the page. Say the image is called abd.jpg and is in the same folder as the index.html.

Many thanks,

CC.
 
Old 03-31-2010, 09:04 AM   #2
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,007

Rep: Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191
I think the background idea is the way it is handled. ie you tell your css to handle the image as part
of covering a particular side of the page and then to repeat-y to get it to replicate. (so the snipets you have seen are correct)
 
Old 03-31-2010, 11:15 AM   #3
Completely Clueless
Member
 
Registered: Mar 2008
Location: Marbella, Spain
Distribution: Many and various...
Posts: 899

Original Poster
Rep: Reputation: 70
Quote:
Originally Posted by grail View Post
I think the background idea is the way it is handled. ie you tell your css to handle the image as part
of covering a particular side of the page and then to repeat-y to get it to replicate. (so the snipets you have seen are correct)
Well you may be right, but I can't get it to work. Probably something else I'm doing wrong.
I have taken the image and done the same thing in Photoshop now. It will take a little longer to load the page unless the viewer is on dialup or something, but anyone still using that doesn't deserve to view anything, anyway.

So I shall be marking this one down as "UNSOLVED" - Well, I would if I could find it in the thread tools. ;-)
 
Old 03-31-2010, 12:18 PM   #4
Completely Clueless
Member
 
Registered: Mar 2008
Location: Marbella, Spain
Distribution: Many and various...
Posts: 899

Original Poster
Rep: Reputation: 70
[QUOTE=grail;3919190]I th

Last edited by Completely Clueless; 03-31-2010 at 12:20 PM. Reason: spanish internet problem
 
Old 03-31-2010, 08:22 PM   #5
graemef
Senior Member
 
Registered: Nov 2005
Location: Hanoi
Distribution: Fedora 13, Ubuntu 10.04
Posts: 2,379

Rep: Reputation: 148Reputation: 148
What exactly did you try to get this as unsolved?

Here is an untested idea:

Place a div in the location that you want. In that div set the style to a CSS style that has a repeating image background. Does that get close to what you are trying to do?
 
Old 03-31-2010, 09:02 PM   #6
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,007

Rep: Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191
Firstly try graemef's suggestion, but second, maybe you could show us your snippet and we can see where you are going wrong?
 
Old 03-31-2010, 09:15 PM   #7
graemef
Senior Member
 
Registered: Nov 2005
Location: Hanoi
Distribution: Fedora 13, Ubuntu 10.04
Posts: 2,379

Rep: Reputation: 148Reputation: 148
Quote:
Originally Posted by Completely Clueless View Post
It will take a little longer to load the page unless the viewer is on dialup or something, but anyone still using that doesn't deserve to view anything, anyway.
Not everyone in the world has a choice. Before moving to Vietnam I was living in Papua New Guinea, a slow expensive connection was all that was on offer.

What I would suggest (if you haven't already done this) is that you look at trying to reduce the size of the image. Usually that can be done without significant sacrifice to the quality, remember you don't need to have print quality images on a web page.
 
Old 04-01-2010, 08:16 AM   #8
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,007

Rep: Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191
Ok... so I did a little more poking and this worked for my test picture:

css file
Code:
body{
    background-image: url('spawn_angel.jpg'),url('spawn_angel.jpg');
    background-repeat: repeat-y;
    background-position: right top, left top;
}
 
Old 04-04-2010, 06:56 AM   #9
Completely Clueless
Member
 
Registered: Mar 2008
Location: Marbella, Spain
Distribution: Many and various...
Posts: 899

Original Poster
Rep: Reputation: 70
Okay, thanks for your input, grail and graemef.

The image I created with Photoshop does load a little slowly even with broadband, so if time permits I may try your suggested solutions. It's not a good position to be in at the moment for me, though, since it's Easter and I'm in the middle of moving house. Nevertheless, I shall try to give it another go as soon as time permits.

One other point. I got this template for 60 bux over the web and I can't parse it through the W3com compliance tester since it(the sixty dollar template) doesn't have a charset declaration specified in its header. So I am getting some spurious characters rendering in different browsers. Yeah, call me a cheapskate. Anyway, the guy who wrote the 'plate has since gone bust, but from what I can gather he was American. Now, would anyone care to speculate on what the most likely charset for this template would be? I need to stick something in the head section and guess maybe one of the 3 most popular US charsets might yield some improvement in page rendering.
By now you will have gathered I ain't no professional web developer. Please clue me up. :-)
 
Old 04-04-2010, 08:42 AM   #10
graemef
Senior Member
 
Registered: Nov 2005
Location: Hanoi
Distribution: Fedora 13, Ubuntu 10.04
Posts: 2,379

Rep: Reputation: 148Reputation: 148
Without seeing the template it's difficult to know the charset used.Obviously it would be great if it was UTF-8 but if I had to take a guess I'd go for a Windows specific one: Windows-1252.

As for your image what format have you saved it as, the format is normally given by the file extension?
 
Old 04-04-2010, 09:28 AM   #11
graemef
Senior Member
 
Registered: Nov 2005
Location: Hanoi
Distribution: Fedora 13, Ubuntu 10.04
Posts: 2,379

Rep: Reputation: 148Reputation: 148
You might find the following link helpful Character Sets
 
Old 04-05-2010, 05:05 AM   #12
Completely Clueless
Member
 
Registered: Mar 2008
Location: Marbella, Spain
Distribution: Many and various...
Posts: 899

Original Poster
Rep: Reputation: 70
Quote:
Originally Posted by graemef View Post
Without seeing the template it's difficult to know the charset used.Obviously it would be great if it was UTF-8 but if I had to take a guess I'd go for a Windows specific one: Windows-1252.

As for your image what format have you saved it as, the format is normally given by the file extension?
Thanks for the charset steers. As for the format, the image is a jpg.
I know this is not the most efficient encoding, but it is a photo of a sliver of a gold coin and gold is a tricky 'colour' to reproduce in the leaner and meaner formats.
 
Old 04-05-2010, 06:06 AM   #13
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Quote:
Originally Posted by Completely Clueless View Post
...
gold is a tricky 'colour' to reproduce in the leaner and meaner formats.
Could you please elaborate ?
 
Old 04-05-2010, 10:16 PM   #14
graemef
Senior Member
 
Registered: Nov 2005
Location: Hanoi
Distribution: Fedora 13, Ubuntu 10.04
Posts: 2,379

Rep: Reputation: 148Reputation: 148
I don't think that it is gold as such that is the problem but that you are dealing with a photograph and so many different colours are used to make the coin look "real". For photos, jpg is a reasonable format to use, however jpg does have different levels of compression. You may want to play around with that, increasing the compression level and seeing what it looks like. You want to avoid the fuzzy appearance that too much compression will generate but often you can do quite well.

Some further thoughts what is the dimensions of the image and what is your current file size?
 
Old 04-13-2010, 10:31 AM   #15
Completely Clueless
Member
 
Registered: Mar 2008
Location: Marbella, Spain
Distribution: Many and various...
Posts: 899

Original Poster
Rep: Reputation: 70
Quote:
Originally Posted by graemef View Post
what is the dimensions of the image and what is your current file size?
Thanks, guys,

Linear dimensions for this repeatable image element are approximately 5mm height and 35mm width. The file size for each of these segments is 14kB in .jpg, down from 195kB .raw with no serious diminution in quality thanks to GIMP's re-rendering engine.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
QUICK Install Query S1NN3R Slackware 4 10-17-2009 03:58 PM
LXer: Even Faster Web Sites: Performance Best Practices for Web Developers LXer Syndicated Linux News 0 07-07-2009 10:21 PM
Web query to execute commands and output it to a web page ! ashes_sheldon Linux - Newbie 1 05-08-2009 02:45 AM
Quick Postfix relay query jhp Linux - Networking 2 08-05-2004 06:26 AM
A quick Mozilla query coolamit78 Linux - Software 3 10-27-2003 09:34 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:58 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration