Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
positioning text around background image
Old 06-20-2010, 05:42 AM positioning text around background image
Novice Talker

Posts: 11
Name: Bob
Trades: 0
hi

I'm very new to CSS, I've searched but haven't found a solution and would welcome your ideas
Currently I've got a page with a background image which is 800x600 positioned center center. That all looks good.
I want to display some text/a url beneath and in line with the bottom right corner of the image.

i.e. imagining this is an image below (text mockup)

........................................|
........................................|
........................................|
........................................|
........................................|
........................................|
_________________________|

>>>>>>>>>>Text & URL here


a) How can I set that text/url to position in relation to the image (which moves depending on the size of the browser)?
b) Can that image stay as background and if not how do I make it foreground?

Thank you

Last edited by Sooperb; 06-20-2010 at 05:50 AM..
Sooperb is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 06-20-2010, 06:27 AM Re: positioning text around background image
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,376
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
put them in a container and align the text right
HTML Code:
<div>
<div>with BG image</div>
<div style="text-align:right;">Text goes here<div>
</div>
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 06-20-2010, 11:47 AM Re: positioning text around background image
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
But, if you want the text at the bottom right corner, then you'll have to set the div with the bg image to position: relative, then use the bottom and right properties to position the div with the text in it.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 06-21-2010, 03:49 PM Re: positioning text around background image
Novice Talker

Posts: 11
Name: Bob
Trades: 0
hi
I'd prefer to make everything centered so that it looks symmetrical on any screen size and have been trailing these suggestions. Is there a way to make the text exactly relative to the image? ie. if the image is centered on the page, can the text be relative from center, or is relative only for from top/bottom/left/right etc?
thanks
Sooperb is offline
Reply With Quote
View Public Profile
 
Old 06-21-2010, 04:44 PM Re: positioning text around background image
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,376
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
use text-align:center; instead
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 06-22-2010, 05:23 AM Re: positioning text around background image
Novice Talker

Posts: 11
Name: Bob
Trades: 0
Quote:
Originally Posted by chrishirst View Post
use text-align:center; instead
I appreciate the suggestion but how can one align the text completely relative to the image? It makes them both centered but I need the text over to the right (off centre).

Thanks in advance
Sooperb is offline
Reply With Quote
View Public Profile
 
Old 06-22-2010, 05:58 AM Re: positioning text around background image
shivaji's Avatar
Ultra Talker

Posts: 321
Trades: 0
CSS:
Code:
#image{
	position:relative;
	display: block;
	margin: 0 auto;
	height:600px;
	width:800px;
	background:transparent url(../images/some_image.jpg) no-repeat 0 0;
}
#image_text{
	margin: 0 auto;
	height:20px;
	width:800px;
	text-align: right;
}
HTML:
Code:
<div id="image"> </div>
<div id="image_text">Some text</div>
__________________

Please login or register to view this content. Registration is FREE
- uncommon free scripts

Please login or register to view this content. Registration is FREE
- Städte, Sport, Party, Gourment, Apartments, Hotels
shivaji is offline
Reply With Quote
View Public Profile Visit shivaji's homepage!
 
Old 06-22-2010, 07:42 AM Re: positioning text around background image
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,376
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Quote:
Originally Posted by Sooperb View Post
I appreciate the suggestion but how can one align the text completely relative to the image? It makes them both centered but I need the text over to the right (off centre).

Thanks in advance
Which is what you will get using the code in post#2
centre the PARENT container and the image AND TEXT stay in position relative to each other!

Then you aparrently change the parameters
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 06-22-2010, 06:49 PM Re: positioning text around background image
Novice Talker

Posts: 11
Name: Bob
Trades: 0
I appreciate your patience and suggestion(s), the code in post #7 (thank you) or #2 (thank you) lays it out well except it's at the top of the page, and I need the whole lot vertically aligned in the center/middle height of the page.

Thanks
Sooperb is offline
Reply With Quote
View Public Profile
 
Old 06-22-2010, 06:52 PM Re: positioning text around background image
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,376
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
http://www.webmaster-talk.com/css-fo...r-website.html
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 06-23-2010, 12:51 AM Re: positioning text around background image
Novice Talker

Posts: 11
Name: Bob
Trades: 0
finally nailed it, many thanks for your help.
Sooperb is offline
Reply With Quote
View Public Profile
 
Old 06-23-2010, 02:17 AM Re: positioning text around background image
Novice Talker

Posts: 8
Trades: 0
well thats nice tutorials buddy.
alibills is offline
Reply With Quote
View Public Profile
 
Old 06-23-2010, 06:37 AM Re: positioning text around background image
marcus deli's Avatar
Skilled Talker

Posts: 72
Name: Marcus Deli
Trades: 0
Usually the text will be placed over the background image, try this guide: http://www.the-art-of-web.com/css/textoverimage/
marcus deli is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to positioning text around background image
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 4.32369 seconds with 12 queries