[advanced search]
 

Go Back   NamePros.com > Discussion > Web Design & Development > Programming

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.


Closed Thread
 
LinkBack Thread Tools
Old 07-15-2008, 09:41 PM   #1 (permalink)
NamePros Regular
 
snike's Avatar
 
Join Date: Mar 2006
Location: USA
Posts: 474
7.38 NP$ (Donate)

snike has a spectacular aura aboutsnike has a spectacular aura about

Save a Life
CSS positioning and repeating backgrounds help

Is it possible to have a background start at point (0px,110px) and repeat downward? Is there anyway to do this or mimick this?

Thanks in advace.
snike is offline  
Old 07-15-2008, 10:26 PM   #2 (permalink)
Account Closed
 
Sergio965's Avatar
 
Join Date: Apr 2004
Location: ~root
Posts: 1,095
1,505.80 NP$ (Donate)

Sergio965 is a splendid one to beholdSergio965 is a splendid one to beholdSergio965 is a splendid one to beholdSergio965 is a splendid one to beholdSergio965 is a splendid one to beholdSergio965 is a splendid one to beholdSergio965 is a splendid one to behold


Sure. You could create a div and do this:

#div {
position: absolute;
top: 0px;
left: 110px;
width: 300px;
height: 100px;
background: url(background.gif) repeat-y;
}

Basically, this well place your image 110 pixels to the right of the top left corner of the screen and repeat your background down from there with the constraint of 300px width. To call it, use: <div id="div"></div> Of course.

Sergio965 is offline  
Old 07-16-2008, 05:25 AM   #3 (permalink)
NamePros Member
 
Join Date: Jun 2008
Posts: 33
0.00 NP$ (Donate)

name-cloud is an unknown quantity at this point


Or you could use body {background-position: 0 110px;}. Check www.w3schools.com
__________________
business: name-cloud.com
blog: patdryburgh.net

I strongly recommend MediaTemple.net for web hosting.
name-cloud is offline  
Old 07-16-2008, 11:20 AM   #4 (permalink)
NamePros Regular
 
snike's Avatar
 
Join Date: Mar 2006
Location: USA
Posts: 474
7.38 NP$ (Donate)

snike has a spectacular aura aboutsnike has a spectacular aura about

Save a Life
Thanks! I'll try it out soon and I'll let u know/

This did not work the way i wanted it to. The text shouldn't start where the background starts but at the top where there is no background and continue downward.

Sorry. Is this possible?
snike is offline  
Old 07-16-2008, 02:13 PM   #5 (permalink)
Senior Member
 
nasaboy007's Avatar
 
Join Date: Jul 2005
Location: NJ
Posts: 1,112
1,454.30 NP$ (Donate)

nasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud of


you would have to make multiple divs then, one without the backgruond (for the text) and then the second one with the background.

or you could just position the backgruond div usign absolute (so its down further) and then use something like margin-top:-200px; or w/e, but im not sure if that'll work.
nasaboy007 is offline  
Old 07-16-2008, 06:02 PM   #6 (permalink)
Account Closed
 
Sergio965's Avatar
 
Join Date: Apr 2004
Location: ~root
Posts: 1,095
1,505.80 NP$ (Donate)

Sergio965 is a splendid one to beholdSergio965 is a splendid one to beholdSergio965 is a splendid one to beholdSergio965 is a splendid one to beholdSergio965 is a splendid one to beholdSergio965 is a splendid one to beholdSergio965 is a splendid one to behold


Quote:
Originally Posted by snike
Thanks! I'll try it out soon and I'll let u know/

This did not work the way i wanted it to. The text shouldn't start where the background starts but at the top where there is no background and continue downward.

Sorry. Is this possible?
I'm not too familiar with the "background-position" element of CSS, but it seems like it might do the trick without using so much code. Either way, this is the code I came up with.

CSS:
Code:
#text {
background-image: url(bg.jpg); //Picture we will use.
background-repeat: repeat-y; //States to repeat on the y axis (vertically.)
background-position: 110px 100px; 
// Background Position moves the background 110px right and 100px down within its current element. It will not move the background itself, but within the container...
height: 300px; //Sets the height of the div.
}

<=== or ===>

#text {
background: url(bg.jpg) repeat-y 110px 100px; //Condensed.
height: 300px;
}
HTML
Code:
<div id="text">Your text here.</div>
And there you have it. Do note that they above form of coding in CSS isn't quite standard and thus shouldn't be used unless you're trying to teach someone the elements in the condensed version.

Good Luck!

Last edited by Sergio965; 07-16-2008 at 06:06 PM.
Sergio965 is offline  
Old 07-18-2008, 12:28 AM   #7 (permalink)
NamePros Regular
 
snike's Avatar
 
Join Date: Mar 2006
Location: USA
Posts: 474
7.38 NP$ (Donate)

snike has a spectacular aura aboutsnike has a spectacular aura about

Save a Life
Thank you everyone!!!

It worked out fine. Thanks!
snike is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Site Sponsors
Advertise your business at NamePros

All times are GMT -7. The time now is 02:07 PM.


Powered by: vBulletin® Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0
Template-Modifications by TMS
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85