473,385 Members | 2,028 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Hiding text behind an image

At <http://snow.prohosting.com/srcopan/dry/test.es.html>, you will see
that the background image runs down the left margin. The right hand side
of it is faded, watermark style, but it is one single image.

my intention is for the header and text to appear to the right of the
unfaded portion of the image, and on top of the watermarked portion. At
most viewport widths it works as intended. However, if the viewport is
narrowed enough to require horizontal scrolling, the header and text slide
over the background image. This does not surprise me (it's a _background_
image, after all) but it is not my intention.

My intention is that when horizontal scrolling is required, the unfaded
portion of the image not be obscured, as if the text were sliding under
it. What I do not know is how to do this. Clip? Chop the image into two
parts and give the unfaded part a higher z-index than the text? All ideas
welcome. Feel free to comment upon anything else you might notice as well.

Many thanks,
--
Warren Post
Santa Rosa de Copán, Honduras
http://srcopan.vze.com/

Sep 12 '06 #1
8 3908
Warren Post <wp***@hondutel.hnwrote:
>At <http://snow.prohosting.com/srcopan/dry/test.es.html>, you will see
that the background image runs down the left margin. The right hand side
of it is faded, watermark style, but it is one single image.

my intention is for the header and text to appear to the right of the
unfaded portion of the image, and on top of the watermarked portion. At
most viewport widths it works as intended. However, if the viewport is
narrowed enough to require horizontal scrolling, the header and text slide
over the background image.
I presume you mean over the unfaded part of the background image?
>This does not surprise me (it's a _background_
image, after all) but it is not my intention.
I'm not seeing that, what browser are you seeing this with? Can you
provide a screenshot?

--
Spartanicus
Sep 12 '06 #2
"Spartanicus" wrote
I'm not seeing that, what browser are you seeing this with? Can you
provide a screenshot?
In IE the two (missing) images on the right eventually get pushed over onto
the unfaded background. Is that what you are talking about, Warren?
Sep 12 '06 #3
El Tue, 12 Sep 2006 22:05:55 +0100, Spartanicus escribió:
Warren Post <wp***@hondutel.hnwrote:
>>...if the viewport is
narrowed enough to require horizontal scrolling, the header and text
slide over the background image.

I presume you mean over the unfaded part of the background image?
Correct. Sorry for my ambiguity.
>>This does not surprise me (it's a _background_ image, after all) but it
is not my intention.

I'm not seeing that, what browser are you seeing this with? Can you
provide a screenshot?
Firefox 1.5, Opera 9.0, IE 6, all on Linux (the latter running within
Crossover Office).

I have posted two screenshots. They were taken with Firefox, but I see the
same thing in Opera and IE. The first screenshot
<http://snow.prohosting.com/srcopan/dry/screenshots/1.jpgshows the
viewport narrow enough to require horizontal scrolling, but I have not yet
scrolled. Everything looks fine here. Then I scroll horizontally in the
second screenshot
<http://snow.prohosting.com/srcopan/dry/screenshots/2.jpg>. The header
image, top navigation bar, and content text all slide over the unfaded
part of the background image.

Thanks again for your help,
--
Warren Post
Santa Rosa de Copán, Honduras
http://srcopan.vze.com/

Sep 13 '06 #4
El Tue, 12 Sep 2006 23:47:40 +0000, Bill Norton escribió:
In IE the two (missing) images on the right eventually get pushed over
onto the unfaded background. Is that what you are talking about, Warren?
No, although to clarify what I mean I have simplified my example somewhat
and provided a sample image. See my reply to Spartanicus for screenshots.

--
Warren Post
Santa Rosa de Copán, Honduras
http://srcopan.vze.com/

Sep 13 '06 #5
Warren Post <wp***@hondutel.hnwrote:
>Then I scroll horizontally in the
second screenshot
Scrolling horizontally was the missing bit of data.

Specifying "background-attachment:fixed" pins your image to the viewport
http://www.w3.org/TR/CSS21/colors.ht...und-attachment

A brief explanation of the relevant phrases, just in case you are not
familiar with them: the "viewport" is the visible area inside a browser
document window or tab, it is your view onto the document, or part view
if the viewport isn't big enough to display it all. "Underneath" the
viewport lies the "canvas", this is the area on which the document is
rendered.

If the content doesn't fit in the viewport then the browser will
generate scollbars. By using the scrolling mechanism you effectively
move the viewport over the (in this case larger) canvas to enable you to
see the remaining content. During scrolling a
"background-attachment:fixed" image will remain pinned to the viewport,
not the canvas.

With CSS2.x it is not possible to have an image positioned with respect
to the viewport for vertically overflowing content, whilst positioning
it with respect to the canvas for horizontally overflowing content.

--
Spartanicus
Sep 14 '06 #6
El Thu, 14 Sep 2006 09:15:13 +0100, Spartanicus escribió:
Warren Post <wp***@hondutel.hnwrote:
>>Then I scroll horizontally in the
second screenshot

Scrolling horizontally was the missing bit of data.

Specifying "background-attachment:fixed" pins your image to the viewport
http://www.w3.org/TR/CSS21/colors.ht...und-attachment

A brief explanation of the relevant phrases, just in case you are not
familiar with them: the "viewport" is the visible area inside a browser
document window or tab, it is your view onto the document, or part view
if the viewport isn't big enough to display it all. "Underneath" the
viewport lies the "canvas", this is the area on which the document is
rendered.

If the content doesn't fit in the viewport then the browser will
generate scollbars. By using the scrolling mechanism you effectively
move the viewport over the (in this case larger) canvas to enable you to
see the remaining content. During scrolling a
"background-attachment:fixed" image will remain pinned to the viewport,
not the canvas.

With CSS2.x it is not possible to have an image positioned with respect
to the viewport for vertically overflowing content, whilst positioning
it with respect to the canvas for horizontally overflowing content.
Yes, and in fact pinning the image of the bottle to the viewport, not the
canvas, is what I intended. I wish the image to remain fixed relative to
the viewport even when the content is scrolled horizontally. Hence my use
of background-attachment:fixed.

What I am looking for is ideas on how to obscure that part of the content
that now overlays the unfaded part of the background image when the
content is horizontally scrolled. The appearance I seek is that the
bottle is over, not under, the horizontally scrolled content.

My code as it stands doesn't cut it, but more to the point, I am unsure
conceptually how to proceed. I could of course not set the bottle as a
background image and give it a higher z-index than the content, but then
it would not be fixed relative to the viewport. All ideas welcome (and
thanks, Spartanicus and Bill, for your observations thus far).

--
Warren Post
Santa Rosa de Copán, Honduras
http://srcopan.vze.com/

Sep 14 '06 #7
Warren Post <wp***@hondutel.hnwrote:
>What I am looking for is ideas on how to obscure that part of the content
that now overlays the unfaded part of the background image when the
content is horizontally scrolled. The appearance I seek is that the
bottle is over, not under, the horizontally scrolled content.
I see. This could be done using a position:fixed element with the
unmasked half of the bottle as a background, but IE doesn't support
position:fixed, and it would result in partially masked content when
scrolled horizontally, text would become unreadable.

Best just let the bottle scroll.

--
Spartanicus
Sep 14 '06 #8
El Thu, 14 Sep 2006 22:29:26 +0100, Spartanicus escribió:
...This could be done using a position:fixed element with the unmasked
half of the bottle as a background, but IE doesn't support position:fixed,
and it would result in partially masked content when scrolled
horizontally, text would become unreadable.

Best just let the bottle scroll.
I see what you mean, and yet my client is pretty insistent on having this.
I'll ponder this some more. Thanks for your thoughts, Spartanicus.

--
Warren Post
Santa Rosa de Copán, Honduras
http://srcopan.vze.com/

Sep 15 '06 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Scott Rankin | last post by:
Hello All, I have a problem that I've been struggling with for a couple of days. The situation is such: I have an image (19 pixels high) that is followed by a text element which has a...
0
by: styler | last post by:
I am having difficulty with the page located here: http://tinyurl.com/2zwa9 I am creating a number of image sets (some left-, some right-aligned; an example of the right-aligned is shown the...
4
by: web_design | last post by:
I put this together from some other scripts I am using on a site. I'm trying to make a better email hiding script. It isn't working. Also, it causes Internet Explorer 6 SP2 to block the script...
1
by: Amber | last post by:
The DataGrid allows you to make columns visible or invisible on demand - even edit and other special columns. This article will show you how it is done. Some developers have reported problems...
4
by: CGuy | last post by:
Hi Gurus, I have a rather unique requirements in my ASP.NET application - I need to create image buttons on the fly while rendering a page. The scenario is like this - the user can enter some...
10
by: FX | last post by:
I wanna publish a script on my site which allows me to hide image source. i have rough idea abt it. i`ll point src to some php page like: <img src="image.php"> & in tht php wat exactly shud be...
1
by: randyrhandz | last post by:
Hi!! I have a table with image inside. In a mouseover event the image will fade and the text will appear. My problem is I cant put the text behind the image because the text floats outside the image.
1
by: Doug | last post by:
Hi I have an img control I am trying to hide upon certain types of commands in my code behind. When to hide it is directly tied to a asp:dropdownlist control. So depending on what the user...
0
by: bharathreddy | last post by:
Hi All, I am using a listview control in my usercontrol so that it can be used in more than one form. This user control has one column extraw, so i want to make it invisible depending on the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.