NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page CSS positioning and repeating backgrounds help

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

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 07-15-2008, 10:41 PM THREAD STARTER               #1 (permalink)
NamePros Regular
 
snike's Avatar
Join Date: Mar 2006
Location: USA
Posts: 497
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, 11:26 PM   #2 (permalink)
Account Closed
 
Sergio965's Avatar
Join Date: Apr 2004
Location: ~root
Posts: 1,091
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, 06:25 AM   #3 (permalink)
NamePros Member
Join Date: Jun 2008
Posts: 33
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, 12:20 PM THREAD STARTER               #4 (permalink)
NamePros Regular
 
snike's Avatar
Join Date: Mar 2006
Location: USA
Posts: 497
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, 03:13 PM   #5 (permalink)
Senior Member
 
nasaboy007's Avatar
Join Date: Jul 2005
Location: NJ
Posts: 1,219
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 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, 07:02 PM   #6 (permalink)
Account Closed
 
Sergio965's Avatar
Join Date: Apr 2004
Location: ~root
Posts: 1,091
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
 



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
????: NamePros.com http://www.namepros.com/programming/493252-css-positioning-and-repeating-backgrounds-help.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 07:06 PM.
Sergio965 is offline  
Old 07-18-2008, 01:28 AM THREAD STARTER               #7 (permalink)
NamePros Regular
 
snike's Avatar
Join Date: Mar 2006
Location: USA
Posts: 497
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


Liquid Web Smart Servers  
All times are GMT -7. The time now is 01:45 PM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger