473,382 Members | 1,726 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,382 software developers and data experts.

Making stylesheets (CSS) with self-adjusting height

Hi i have following stylesheet:

..linklist
{
width: 100%;
font-size: 75%;
background: #EEEEEE;
margin: 5px;
height: 300px;
overflow: auto;
}

I want to display a container which is maimum 300px width - when there is
more content in it - it displays scrollbars, if there is less content in
it - it adjust that it has < 300px.

thanx for help excuse my poor english ;)

Jul 20 '05 #1
8 4077
slawek wrote:
I want to display a container which is maimum 300px width
max-width: 300px;
when there is more content in it - it displays scrollbars,


Ugh. Horizontal scrollbars are terrible for accessibility.

--
Brian (remove ".invalid" to email me)
http://www.tsmchughs.com/
Jul 20 '05 #2
Brian wrote:
slawek wrote:
I want to display a container which is maimum 300px width

max-width: 300px;
when there is more content in it - it displays scrollbars,

Ugh. Horizontal scrollbars are terrible for accessibility.


How so ?
Matthias
Jul 20 '05 #3
Matthias Gutfeldt <sa************@gmx.net> wrote in news:2o45q5F6m0e2U1@uni-
berlin.de:
Brian wrote:
slawek wrote:
I want to display a container which is maimum 300px width

max-width: 300px;


Note that this doesn't work in Internet Explorer...

--
'Give a starving man a fish, and he'll eat for a day. Teach him how to cook a
fish, though, and he'll starve to death with a clearer picture of what he's
missing.'
- The Onion
Jul 20 '05 #4

"Matthias Gutfeldt" <sa************@gmx.net> wrote in message
news:2o************@uni-berlin.de...
Brian wrote:
slawek wrote:
I want to display a container which is maimum 300px width

max-width: 300px;
when there is more content in it - it displays scrollbars,

Ugh. Horizontal scrollbars are terrible for accessibility.


How so ?

It can require scrolling back and forth to read *every line*, which is
annoying for everybody but burdensome for some people. Also (to the best of
my knowledge), there is no keyboard-based method (corresponding to the
page-up, page-down keys for vertical scrolling) to accomplish it.

Jul 20 '05 #5
Matthias Gutfeldt wrote:
Brian wrote:
Ugh. Horizontal scrollbars are terrible for accessibility.


How so ?


It's an accessability issue because it's more difficult than vertical
scrolling. Vertical scrolling is more natural for most people due to
the way text is read from left to right (or right to left), and pages
are read from top to bottom. It's also easier to move the hand
vertically to drag a scroll bar, and easier to read text moving
vertically instead of horizontally. Also, many people have scroll
wheels on their mouse that only work vertically (if they have one at
all) — not everyone has two scroll wheels, Tilt Wheel, or equivalent, so
they need to drag the scrollbar sideways.

Perhaps horizontal scrolling would be more natural for cultures that
write lines vertically, rather than horizontally; but that's an i18n
issue, and I don't know if any browsers do vertical text for them or if
they're just forced to read horizontally.

--
Lachlan Hunt
http://www.lachy.id.au/

Please direct all spam to ab***@127.0.0.1
Thank you.
Jul 20 '05 #6
> ...
Note that this doesn't work in Internet Explorer...


I've found a way to do it in explorer.
http://www.svendtofte.com/code/max_width_in_ie/

Thanx for all answers ;)
Jul 20 '05 #7
slawek wrote:
I've found a way to do it in explorer.
http://www.svendtofte.com/code/max_width_in_ie/


Great! /another proprietary IE extension/!!! They should have
implemented that expression() function with a -ie- prefix, if at all.
This one is exceptionally bad because it also depends on JavaScript;
which is not supported by every UA, and thus there is no chance that it
would ever be included in CSS, though there have been proposals for a
calc() function (but that would not use JavaScript). I don't understand
why IE has put in so much effort to implement proprietary technologies,
while failing to implement standards.

If you're going to use that property, at least keep it in a seperate
stylesheet, and preferably one that is hidden from everything but IE.
You can use conditional comments [1], or one of Tantek's highpass or
midpass filters [2]. Or, you may wish to take a look at Dean Edward's
IE7 [3], which solves the min/max-width/height problems as well as many
more.

[1] Note: Conditional comments are another proprietary IE technology,
yet the "downlevel-hidden" version is a valid SGML/XML comments, so
the validity of the page is not affected, and they are ignored by
all other UAs. The "downlevel-revealed" is not a valid comment, and
must not be used.
http://msdn.microsoft.com/workshop/a...omment_ovw.asp
[2] http://www.tantek.com/CSS/Examples/
[3] http://dean.edwards.name/IE7/

--
Lachlan Hunt
http://www.lachy.id.au/

Please direct all spam to ab***@127.0.0.1
Thank you.
Jul 20 '05 #8
On Sat, 14 Aug 2004 14:36:20 GMT, Lachlan Hunt wrote:
...I don't understand why IE has put in so
much effort to implement proprietary technologies,
while failing to implement standards.


...does the term 'MicrobaStard'
suggest any answers? ;-)

--
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology
Jul 20 '05 #9

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

Similar topics

72
by: Herbert | last post by:
I'm still relativey new to stylesheets, so I'm hoping that the way I'm going about things can be seriously improved upon, i.e . I just haven't undersood something obvious about the 'cascading'...
3
by: jason baumunk | last post by:
I author applications in php which use external stylesheets. When viewed through ie 6, netscape 6, et al. occassionally the stylesheets will not load or be applied. Has anybody encountered this...
14
by: Jeff Gillingham | last post by:
I'm using a stylesheet to place a small 'background image' in the upper left corner of several pages. Is there a simple way of making that image a clickable link? Thanks.
13
by: Toby A Inkster | last post by:
www.authoring.stylesheets] For ages I have provided links to alternate stylesheets from my pages as per W3C recommendations: <link rel="stylesheet" href="baz" type="text/css" title="Baz"...
6
by: Jan Roland Eriksson | last post by:
Archive-name: www/stylesheets/newsgroup-faq Posting-Frequency: twice a week (mondays and thursdays) Last-modified: March 10, 2001 Version: 1.95 URL: http://css.nu/faq/ciwas-mFAQ.html Maintainer:...
2
by: Jan Roland Eriksson | last post by:
Archive-name: www/stylesheets/newsgroup-faq Posting-Frequency: once a week Last-modified: 2004-07-26 Version: 2.00 URL: <http://css.nu/faq/ciwas-mFAQ.html> Maintainer: Jan Roland Eriksson...
0
by: Jan Roland Eriksson | last post by:
Archive-name: www/stylesheets/newsgroup-faq Posting-Frequency: once a week Last-modified: 2004-07-26 Version: 2.00 URL: <http://css.nu/faq/ciwas-mFAQ.html> Maintainer: Jan Roland Eriksson...
0
by: Jan Roland Eriksson | last post by:
Archive-name: www/stylesheets/newsgroup-faq Posting-Frequency: once a week Last-modified: 2004-07-26 Version: 2.00 URL: <http://css.nu/faq/ciwas-mFAQ.html> Maintainer: Jan Roland Eriksson...
9
by: Arancaytar | last post by:
I have so far seen two methods for including external resources as CSS stylesheets in a document. The first is this: <link href="/stylesheets/style.css" rel="stylesheet" type="text/css" /> And...
9
by: johkar | last post by:
I need some browser implementation clarification. In the below example, the alternate stylesheet could be invoked by user agents that support alternate stylesheets or by script. Are there any...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.