473,465 Members | 1,651 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Preventing stuff from "sliding under" floats

I suspect that this is a common problem (and so with a known
solution/work-around), but my attempts to find it have failed.

I have a float (a table of content box) on the left of a page. The
headers within the main material either have distinct background colors
or borders. These borders don't seem to recognize that they are in
material that is wrapped around the float.

I can force specific headers to have sufficiently large left margins,
but since I refuse to design to a specific browser window width, I can't
determine which headers need to have that extra left margin.

-j

--
Jeffrey Goldberg http://www.goldmark.org/jeff/
I rarely read top-posted, over-quoted or HTML posts
My Reply-To address is valid.
Sep 21 '06 #1
6 1676
Jeffrey Goldberg <no****@goldmark.orgwrote:
>I suspect that this is a common problem (and so with a known
solution/work-around), but my attempts to find it have failed.

I have a float (a table of content box) on the left of a page. The
headers within the main material either have distinct background colors
or borders. These borders don't seem to recognize that they are in
material that is wrapped around the float.
Only inline content is shortened to make room for the presence of a
float, this does not apply to the width of a block level element.
>I can force specific headers to have sufficiently large left margins,
but since I refuse to design to a specific browser window width, I can't
determine which headers need to have that extra left margin.
There is no proper solution for this problem under CSS2.x (assuming that
you want the background and/or right border to extend to the right edge
of its container).

There are a few workarounds that may be acceptable for headers with
solid coloured backgrounds only, but these hacks don't work properly for
headers with a background image or a border.

--
Spartanicus
Sep 21 '06 #2
Spartanicus wrote:
There are a few workarounds that may be acceptable for headers with
solid coloured backgrounds only, but these hacks don't work properly for
headers with a background image or a border.
I am just using solid colors. So pointers to those workarounds would be
useful.

-j
--
Jeffrey Goldberg http://www.goldmark.org/jeff/
I rarely read top-posted, over-quoted or HTML posts
My Reply-To address is valid.
Sep 21 '06 #3
Jeffrey Goldberg <no****@goldmark.orgwrote:
>There are a few workarounds that may be acceptable for headers with
solid coloured backgrounds only, but these hacks don't work properly for
headers with a background image or a border.

I am just using solid colors. So pointers to those workarounds would be
useful.
http://homepage.ntlworld.ie/spartani...de_a_float.htm

The hack masks the header backgrounds. Note that margins no longer
collapse as usual and a header background will only be partially masked
if it is positioned around the bottom of the float.

Another way of doing this would be to use borders on the float that
match the background of the content.

--
Spartanicus
Sep 21 '06 #4
Spartanicus wrote:
Jeffrey Goldberg <no****@goldmark.orgwrote:
>So pointers to those workarounds would be
useful.

http://homepage.ntlworld.ie/spartani...de_a_float.htm

The hack masks the header backgrounds. Note that margins no longer
collapse as usual and a header background will only be partially masked
if it is positioned around the bottom of the float.
Thanks.

In the example the apparent border around the butterfly is actually part
of the PNG image.

Since I want a thin solid border for my float, I'll have to have an
inner and outer entity. The outer will be the one that floats (and has
the content background color as its own) while the inner one will have
the large left and bottom margins.
Another way of doing this would be to use borders on the float that
match the background of the content.
I would need an inner and outer construct again so I can get my visible
border as well.

Thanks again.

-j

--
Jeffrey Goldberg http://www.goldmark.org/jeff/
I rarely read top-posted, over-quoted or HTML posts
My Reply-To address is valid.
Sep 21 '06 #5
Jeffrey Goldberg <no****@goldmark.orgwrote:
>http://homepage.ntlworld.ie/spartani...de_a_float.htm

The hack masks the header backgrounds. Note that margins no longer
collapse as usual and a header background will only be partially masked
if it is positioned around the bottom of the float.

Thanks.

In the example the apparent border around the butterfly is actually part
of the PNG image.
So? The image in my demo can be given a border with CSS no bother.
>Since I want a thin solid border for my float, I'll have to have an
inner and outer entity. The outer will be the one that floats (and has
the content background color as its own) while the inner one will have
the large left and bottom margins.
You've described the demo, why?

--
Spartanicus
Sep 21 '06 #6
Spartanicus wrote:
You've described the demo, why?
Mostly to clarify things for myself. The demo makes use there being an
<imgwithin a <pin the first place. But in cases where we don't have
a given double containment, we have to create it (though <div>).

I realize that this isn't some great insight or generalization, but it
is a tiny generalization of the demo. Maybe for someone like you who
could look at the demo and instantly see how it worked, I was just
stating the obvious. But for me it was useful to restate in my own
words what the crucial "trick" of the workaround was.

-j
--
Jeffrey Goldberg http://www.goldmark.org/jeff/
I rarely read top-posted, over-quoted or HTML posts
My Reply-To address is valid.
Sep 22 '06 #7

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

Similar topics

1
by: wildchild | last post by:
Hi, I am new to grpahics progamming in/under Borland C. I have included the "graphics.h" header file but i am unable to take input on the screen. if i try to move my cursor to a specified...
7
by: MLH | last post by:
Is there any case you can imagine that A97 would NOT display the Unhide option under the Window menu after running this line... Me.Visible = False Yes, its happening to me. The Unhide choice...
2
by: Alpha | last post by:
It's handy to have the blue sqare mark on all the resutls of the Found lines but how do I remove it once I'm done with that? Thanks, Alpha
5
by: TPS | last post by:
When I set trace enable to true in my web.config file, the debug info does not display at the "bottom" of the page, it displays "under" all of my buttons, labels, grids etc. This behavior...
4
by: Ying Lu | last post by:
Hello, I have a table named "USER" under MySQL database. When I am trying to move tables from MySQL to PostgreSQL, I found that I could not create a table namely "USER". I guess "USER" is a key...
0
by: lisseut | last post by:
Hi, hope I'm posting to the right forum. I'm using C# under .NET 1.1, Windows XP SP2 I have a form and I've overridden WndProc to print to a text box whenever it receives the WM_NCMOUSELEAVE...
1
by: pirunnyrkki | last post by:
Being utterly useless when it comes to JavaScript, I come here for help with an issue that may or may not be an actual problem. Say for example that I have a link that looks like thus: <a...
2
by: one | last post by:
Hi, Was wondering if you could help me out with regards to a server that I'm trying to troubleshoot... Basically we have a windows 2003 load-balanced server that has got sharepoint and mcms...
1
by: MrAsm | last post by:
Hi, I'd like to know if C# object system is based on COM/DCOM, or is it a completely new technology, developed "from scratch"? In other words, does C# use COM "under the hood", or are C#/.NET...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.