Text over an image

This is a discussion on "Text over an image" within the Web Page Design section. This forum, and the thread "Text over an image are both part of the Design Your Website category.



Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Aug 14th, 2007, 12:08
Up'n'Coming Member
Join Date: Jul 2007
Location: Glasgow
Age: 15
Posts: 91
Thanks: 0
Thanked 0 Times in 0 Posts
Text over an image

Hi, I want to put text over an image but I don't know all I can find how to do it with tables.
Reply With Quote

  #2 (permalink)  
Old Aug 14th, 2007, 12:17
1840dsgn's Avatar
SuperMember

SuperMember
Join Date: Jun 2007
Location: Canterbury
Age: 19
Posts: 717
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Text over an image

say it isn in a paragraph:

xhmtl
Code: Select all
 
<p class="textOverImage">This text will go over the image</p>
css
Code: Select all
 
.textOverImage {
   background: url(pathtoyourimage) top left no-repeat;
   width: imagewidth;
   height: imageheight;
}
OK...we assign the class textOverImage to the paragraph and then style the class in our css. Obv you can replace this class anme with whatever you like.

ok:

Code: Select all
 
background: url(pathtoyourimage) top left no-repeat;
Replace pathtoyourimage - with the path to your image!
if it is a reepeating image then you can use repeat (to repeat both directions), repeat-x (to repeat horizontally only) or repeat-y (to repeat vertically only).

At the moment it is set to no-repeat, whcih means it will not repeat.

Code: Select all
 
width: imagewidth;
height: imageheight;
If your image needs ot display as a certain size then you can use width and height to specify this. If you do not specify this then you can delete these two attributes and your image wiull be as big as the paragraph text.

To add padding around the text you can use

Code: Select all
 
padding: 10px;
Where 10px can be your value and c an be in %$ or ems or px.

If you want different padding top left bottom and right you can use the followjing shorthand:

padding: topandbottom leftandright; (eg padding: 10px 5px; would add 10px to top and bottom and 5pxx to the sides)

padding top right bottom left; (eg padding: 2px 3px 4px 5px; would add 2px to top, 3px to right, 4px to bottom and 5px to left)

Hope that helps
Reply With Quote
  #3 (permalink)  
Old Aug 14th, 2007, 12:17
karinne's Avatar
SuperMember

SuperMember
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Text over an image

hmmm ... put the image as a background?!?
Reply With Quote
  #4 (permalink)  
Old Aug 14th, 2007, 12:24
Up'n'Coming Member
Join Date: Jul 2007
Location: Glasgow
Age: 15
Posts: 91
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Text over an image

Can you have 2 background images.
Reply With Quote
  #5 (permalink)  
Old Aug 14th, 2007, 12:36
1840dsgn's Avatar
SuperMember

SuperMember
Join Date: Jun 2007
Location: Canterbury
Age: 19
Posts: 717
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Text over an image

Only if you have two different elements. you can't have two bg images for one element.

Maybe tell us whgat you want to achieve and give us a link and we could help?
Reply With Quote
  #6 (permalink)  
Old Aug 14th, 2007, 12:39
Up'n'Coming Member
Join Date: Jul 2007
Location: Glasgow
Age: 15
Posts: 91
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Text over an image

There seems to be a problem I want multiple paragraphs to be selected and put over 1 image but you code seems to make a new image for ever bit of text.
Attached Images
File Type: png home.html.png (9.9 KB, 17 views)
Reply With Quote
  #7 (permalink)  
Old Aug 14th, 2007, 12:42
Up'n'Coming Member
Join Date: Jul 2007
Location: Glasgow
Age: 15
Posts: 91
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Text over an image

Well I want to make it look like this .
Reply With Quote
  #8 (permalink)  
Old Aug 14th, 2007, 12:43
1840dsgn's Avatar
SuperMember

SuperMember
Join Date: Jun 2007
Location: Canterbury
Age: 19
Posts: 717
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Text over an image

Ok...

in that case put a div round that content.

So you would ahve this:

Code: Select all
 
<div class="textOverImage">  //or whatever you called it
 
    <p>made the navigation...etc</p>
 
    <p> added a heade rto eahc...etc</p>
 
     all the content you want with a bg image.
 
</div>
Reply With Quote
  #9 (permalink)  
Old Aug 14th, 2007, 12:45
karinne's Avatar
SuperMember

SuperMember
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Text over an image

Well ... that's because the code he gave you was just an example. If you would have given us a bit more to go on, we would have stirred you in a better direction.


You'll need 3 background for this to work. One with the top rounded corners that you can apply to the News heading, one with the side to apply to the middle/content and one for the footer.
Reply With Quote
  #10 (permalink)  
Old Aug 14th, 2007, 12:51
1840dsgn's Avatar
SuperMember

SuperMember
Join Date: Jun 2007
Location: Canterbury
Age: 19
Posts: 717
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Text over an image

Quote:
Well ... that's because the code he gave you was just an example
yea, to be honest, you'll never learn if you don't experiment yourself. thats pretty much how I've learnt everything by trying idfferent things and when one works I can then apply it to everything else.

Sure post up here if your really stuck or for a bit of direction. but that code I gave you polus reading some tutorials on background images and searching google should have been enough for you to go off an experiement.
Reply With Quote
Reply

Tags
css, html, image, text

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Image and text caption problem George Web Page Design 8 Feb 27th, 2008 18:14
[SOLVED] Image with text -&gt; text with background alexgeek Web Page Design 5 Nov 13th, 2007 23:25
Text on top of image Dreamweaver CS3 LeeNic Web Page Design 11 Oct 22nd, 2007 12:53
Text/image swap LorEye Website Planning 2 May 19th, 2007 17:43
text next to image ivyholly Web Page Design 5 Dec 21st, 2005 15:49


All times are GMT. The time now is 20:54.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

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