473,606 Members | 3,100 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to make overflow:hidden take effect?

I have a frame which is supposed to contain a list of links. The
clickable area of each link comprises a picture followed by some text.

I want the text to be cut at the right hand side when the user resizes
the frame to be "too narrow".

Right now, the source for that frame looks like this:

<table border="1" width="100%">
<tr style="backgrou nd-color:#C0C0C0">
<td align="center">
<a href="group1">G roup 1</a>
</td>
</tr>
<tr class="menu">
<td>
<div style="whitespa ce:nowrap;overf low:hidden;widt h:auto;">
<a href="link1">
<img border="0" src="img1"> Text 1
</a>
</div>
<div style="whitespa ce:nowrap;overf low:hidden;widt h:auto;">
<a href="link2">
<img border="0" src="img1"> Some long text here
</a>
</div>
</td>
</tr>
<tr style="backgrou nd-color:#C0C0C0">
<td align="center">
<a href="group2">G roup 2</a>
</td>
</tr>
</table>

But the text "Some long text here" is wrapped instead of clipped.

Suggestions?

Kai
Jul 20 '05 #1
6 19396
In article Kai Grossjohann wrote:
I have a frame which is supposed to contain a list of links. The
clickable area of each link comprises a picture followed by some text.

I want the text to be cut at the right hand side when the user resizes
the frame to be "too narrow".

Right now, the source for that frame looks like this:

<table border="1" width="100%">
<tr style="backgrou nd-color:#C0C0C0">
<td align="center">
<a href="group1">G roup 1</a>
</td>
</tr>
<tr class="menu">
<td>
<div style="whitespa ce:nowrap;overf low:hidden;widt h:auto;">
<a href="link1">
<img border="0" src="img1"> Text 1
</a>
</div>
<div style="whitespa ce:nowrap;overf low:hidden;widt h:auto;">
<a href="link2">
<img border="0" src="img1"> Some long text here
</a>
</div>
</td>
</tr>
<tr style="backgrou nd-color:#C0C0C0">
<td align="center">
<a href="group2">G roup 2</a>
</td>
</tr>
</table>

But the text "Some long text here" is wrapped instead of clipped.


Of course it is. You don't define height. Overflow controls overflow. If
there is no overflow, it can't be hidden. There can't be overflow to down
unless height is set, as normal behaviour is that element will be
streched.

Are you sure you are doing right thing? Frames, table layout and
overflow:hidden doesn't sound good.

--
Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
Saapi lähettää meiliä, jos aihe ei liity ryhmään, tai on yksityinen
tjsp., mutta älä lähetä samaa viestiä meilitse ja ryhmään.

Jul 20 '05 #2
Lauri Raittila <la***@raittila .cjb.net> writes:
In article Kai Grossjohann wrote:
But the text "Some long text here" is wrapped instead of clipped.
Of course it is. You don't define height. Overflow controls overflow. If
there is no overflow, it can't be hidden. There can't be overflow to down
unless height is set, as normal behaviour is that element will be
streched.


D'oh. Thanks for pointing this out.

How do I say that I want the table rows to be tall enough to contain
the image and also one row of text (the maximum of these two)?
Are you sure you are doing right thing? Frames, table layout and
overflow:hidden doesn't sound good.


There could be two answers to this.

(A) Of course I know that I'm not doing the right thing, but do you
really have to rub it in?

(B) My boss wants it, so it must be right.

Take your pick ;-)
"Thou shalt make it look like this Windows app here", my boss said.
And that Windows app has a resizable outlook bar on the left hand
side. (It's the kind of bar that MS Outlook has on the left, the bar
contains several groups with icons, each of the icons serves as a
shortcut. The bar is resizable (width only, it stretches the whole
height of the window anyway) by the user by dragging the mouse.) Do
you know of a way to make such a thing without frames?
Oh, regarding the table layout, I plead guilty. I thought that it was
easy to get the "raised button" look by having a table cell with the
right content. But it seems that didn't work. So I'll try to find
another way to do this.
We even bought this hideously expensive JavaScript menu package just
so that we could get menus that look like in Windows XP...
Kai
Jul 20 '05 #3
In article Kai Grossjohann wrote:
Lauri Raittila <la***@raittila .cjb.net> writes:
In article Kai Grossjohann wrote:
But the text "Some long text here" is wrapped instead of clipped.
Of course it is. You don't define height. Overflow controls overflow. If
there is no overflow, it can't be hidden. There can't be overflow to down
unless height is set, as normal behaviour is that element will be
streched.


D'oh. Thanks for pointing this out.

How do I say that I want the table rows to be tall enough to contain
the image and also one row of text (the maximum of these two)?


You can't. Height aplied to table row acts roughly as min-height to other
elements. You would need to wrap contents of each td to something first.
(Didn't notice this probmlem at first as I never use table layout
anymore...)

To set height of that wrapper element you would use height of image and
1em, and then set one of them as height and other as min-height. Not
supported by IE, which I assume your thing needs to work. OTOH, IE has
bug that may help this, but I don't know what it thinks about overflow

You could try white-space:no-wrap and defined (100%) width supposing you
never want wrapping. That might have desired effect.
"Thou shalt make it look like this Windows app here", my boss said.
And that Windows app has a resizable outlook bar on the left hand
side. (It's the kind of bar that MS Outlook has on the left, the bar
contains several groups with icons, each of the icons serves as a
shortcut. The bar is resizable (width only, it stretches the whole
height of the window anyway) by the user by dragging the mouse.) Do
you know of a way to make such a thing without frames?
Never used Outlook bar (nor know what it would look like). Could be
possible with CSS and JS, but that wouldn't be any better. Seems that
this might be use for frames, as it is trying to be aplication, not
webpage.
Oh, regarding the table layout, I plead guilty. I thought that it was
easy to get the "raised button" look by having a table cell with the
right content. But it seems that didn't work. So I'll try to find
another way to do this.


Make it list? That would allow to make it quite easily. Hard to comment
on markup whitout knowledge on what kind of content it would have.

--
Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
Saapi lähettää meiliä, jos aihe ei liity ryhmään, tai on yksityinen
tjsp., mutta älä lähetä samaa viestiä meilitse ja ryhmään.

Jul 20 '05 #4
Lauri Raittila <la***@raittila .cjb.net> writes:
Of course it is. You don't define height. Overflow controls overflow. If
there is no overflow, it can't be hidden. There can't be overflow to down
unless height is set, as normal behaviour is that element will be
streched.


Okay, now I set the height. It's 20px which allows one row to be
visible. But it doesn't do what I need, either:

IE 6 tries to fit the element into a too-narrow column, so instead of

foo bar

it displays

foo
bar

instead. Now it cuts off the bottom part, so I only see

foo

But what I really wanted to see is, say,

foo b

with the "ar" part being cut off. I already added "whitespace:now rap"
to the list of styles to use for my <div>, but it didn't help.

Hm. Let me try "white-space:no-wrap", too... [time passes] No, that
doesn't help, either.

Life is difficult...

Kai
Jul 20 '05 #5
Lauri Raittila <la***@raittila .cjb.net> writes:
In article Kai Grossjohann wrote:
Lauri Raittila <la***@raittila .cjb.net> writes:

"Thou shalt make it look like this Windows app here", my boss said.
And that Windows app has a resizable outlook bar on the left hand
side. (It's the kind of bar that MS Outlook has on the left, the bar
contains several groups with icons, each of the icons serves as a
shortcut. The bar is resizable (width only, it stretches the whole
height of the window anyway) by the user by dragging the mouse.) Do
you know of a way to make such a thing without frames?


Never used Outlook bar (nor know what it would look like). Could be
possible with CSS and JS, but that wouldn't be any better. Seems that
this might be use for frames, as it is trying to be aplication, not
webpage.


I had a hunch, so I tried to describe how the Outlook bar looks and
behaves ;-)

Kai

Jul 20 '05 #6
In article Kai Grossjohann wrote:
Hm. Let me try "white-space:no-wrap", too... [time passes] No, that
doesn't help, either.


Hm, correct would be white-space:nowrap. Try that. (I wonder where the
logic is.)
http://www.w3.org/TR/CSS21/text.html#white-space-prop

Do you have URL?
--
Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
Saapi lähettää meiliä, jos aihe ei liity ryhmään, tai on yksityinen
tjsp., mutta älä lähetä samaa viestiä meilitse ja ryhmään.

Jul 20 '05 #7

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

Similar topics

5
14649
by: Charles Blaquière | last post by:
As part of my explorations in liquid design, I'm exploring ways to use the overflow: hidden property -- when browser windows become too narrow, I want (some) images to get cropped rather than have the layout break up. In some cases, losing parts of images can be an interesting option. http://www.hebig.org/blog/titlepic.php was the first example I found, and it's quite nifty. His image works well when progressively cropped from the right,...
2
3513
by: Jonathan Hunt | last post by:
I'm trying to get the following page to work properly in Opera... http://sytes.org/csstest.html I have a <div> with a large amount of content that doesn't wrap, so I'm trying to crop it to a set size using overflow: hidden; In both Firefox and IE it works as expected, but in Opera I get a huge horizontal scroll bar.
2
1772
by: stefanomnn | last post by:
hello, i have a tetxtarea, with the style overflow:hidden, and a long text. because of the overflow, user does not see the whole text but a part. is there, in an IE browser, a mode to recovery the effective text than user see? Thanks
1
5872
by: RC | last post by:
I have tbody { height: 30em; width: 80em; overflow: hidden; } For FF (Firefox) and NS (Netscape) the height is working fine, no vertical scrolling bar on window. But the width is not effect at all, got the horizontal scrolling bar on the window. I even tried <table width="80%"and <tobdy width="80%"but still no
2
5149
by: SAL | last post by:
I have the following line of code in my Page_Load Event of my ASP.net page: txtExplanationofChange.Attributes.Add ("style","overflow :hidden"); which allows me to can turn off the Scrollbar of my multiline textbox. I am still fairly new to developing in ASP.net and C#, and I'm not sure if there is a better way to disable the scrollbar. The code above turns off the scrollbar just fine, however the textbox does not remain in the location...
5
6892
by: Christopher Night | last post by:
I'm making a Javascript program that uses overflow:hidden on a containing div to crop an image. This page (temporarily) shows an example of what I mean: http://www.people.fas.harvard.edu/~night/crossroads/ The relevant markup is: <div style="overflow:hidden; width: 238px; height:47px; border: thin yellow solid;">
2
15550
by: esteuart | last post by:
I need to get the right combination for a div to clip any text inside and allow vertical alignment. I only have this problem in FireFox. I have 3 divs nested within each other. The outer div has display of table, the first inner div has display of table-cell and the inner-most div has the text. The outer div has a set width and height. So here's the problem: Without the inner divs having a width and height set, the overflow:hidden doesn't...
4
2858
by: zzpat | last post by:
I have a box element that uses overflow: hidden and I want a link which at the bottom of the element to be visible. I can't make the link visible. Obviously I'm having problems so I was wondering if there's anything other than overflow : hidden that will give me an absolute 'height' and make the link visible. Pat
0
8036
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8448
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8126
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8317
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
5987
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5470
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4010
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1572
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1313
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.