|
 |
|
|
03-24-2009, 07:13 PM
|
Last one,,,, for today
|
Posts: 39
Name: Scott Bronson
|
I inserted an image in my CSS code its a big box, in my HTML code I wraped in a DIV tag, is there any way to position text in that box, by default it goes on the bottom, I want to put it in the upper part of it.
|
|
|
|
03-24-2009, 07:28 PM
|
Re: Last one,,,, for today
|
Posts: 42,371
Name: Chris Hirst
Location: Blackpool. UK
|
elements including text will appear in the order they are in the source unless you position them differently.
if you want to overlay text on an image, you would set the image as a background.
__________________
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?
|
|
|
|
03-24-2009, 07:31 PM
|
Re: Last one,,,, for today
|
Posts: 39
Name: Scott Bronson
|
I did that. There is also a placeholder image inside the div tag, I want the text to be in the upper right side of that image. Can that be done?
|
|
|
|
03-24-2009, 07:35 PM
|
Re: Last one,,,, for today
|
Posts: 42,371
Name: Chris Hirst
Location: Blackpool. UK
|
placeholder image? explain what you mean
better still, some code and maybe an image of what you WANT to achieve
__________________
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?
|
|
|
|
03-24-2009, 07:42 PM
|
Re: Last one,,,, for today
|
Posts: 39
Name: Scott Bronson
|
HTML:
<div id="background_image">
<center><img src="placeholder_box.gif" /></center>
</div>
CSS:
#background_image{ background-image:url(hosteagle_background2.jpg)}
I would like to put text to the upper right of the placeholder_box with in the background
|
|
|
|
03-24-2009, 07:56 PM
|
Re: Last one,,,, for today
|
Posts: 42,371
Name: Chris Hirst
Location: Blackpool. UK
|
get rid of the deprecated <center> tags for a start.
HTML Code:
<div id="background_image">
<span>Some text</span>
<img src="placeholder_box.gif" />
</div>
Code:
#background_image {
background-image:url(hosteagle_background2.jpg)
}
#background_image span {
float:right;
}
#background_image img {
display:block;
margin:0 auto;
}
looks about right, assuming I have interpreted your idea correctly
__________________
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?
|
|
|
|
03-25-2009, 10:53 AM
|
Re: Last one,,,, for today
|
Posts: 10,017
Location: Tennessee
|
Question - why would you use a <span> in there when you could apply that css to a heading Hx tag or even a <p> in there ??
__________________
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
|
|
|
|
03-25-2009, 04:24 PM
|
Re: Last one,,,, for today
|
Posts: 42,371
Name: Chris Hirst
Location: Blackpool. UK
|
Quote:
Originally Posted by LadynRed
Question - why would you use a <span> in there when you could apply that css to a heading Hx tag or even a <p> in there ??
|
No particular reason at all
As you say any container would do. Which container element would primarily depend on the use the text was being put to of course.
And it doesn't really need an extra element if it is just for text, applying text-align:right on the parent element would have the same effect.
__________________
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?
|
|
|
|
|
« Reply to Last one,,,, for today
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|