Making stylesheets (CSS) with self-adjusting height

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • slawek

    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 ;)



  • Brian

    #2
    Re: Making stylesheets (CSS) with self-adjusting height

    slawek wrote:
    [color=blue]
    > I want to display a container which is maimum 300px width[/color]

    max-width: 300px;
    [color=blue]
    > when there is more content in it - it displays scrollbars,[/color]

    Ugh. Horizontal scrollbars are terrible for accessibility.

    --
    Brian (remove ".invalid" to email me)

    Comment

    • Matthias Gutfeldt

      #3
      Re: Making stylesheets (CSS) with self-adjusting height

      Brian wrote:[color=blue]
      > slawek wrote:
      >[color=green]
      >> I want to display a container which is maimum 300px width[/color]
      >
      >
      > max-width: 300px;
      >[color=green]
      >> when there is more content in it - it displays scrollbars,[/color]
      >
      >
      > Ugh. Horizontal scrollbars are terrible for accessibility.[/color]

      How so ?


      Matthias


      Comment

      • la_haine

        #4
        Re: Making stylesheets (CSS) with self-adjusting height

        Matthias Gutfeldt <say-no-to-spam@gmx.net> wrote in news:2o45q5F6m0 e2U1@uni-
        berlin.de:
        [color=blue]
        > Brian wrote:[color=green]
        >> slawek wrote:
        >>[color=darkred]
        >>> I want to display a container which is maimum 300px width[/color]
        >>
        >>
        >> max-width: 300px;[/color][/color]

        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

        Comment

        • Harlan Messinger

          #5
          Re: Making stylesheets (CSS) with self-adjusting height


          "Matthias Gutfeldt" <say-no-to-spam@gmx.net> wrote in message
          news:2o45q5F6m0 e2U1@uni-berlin.de...[color=blue]
          > Brian wrote:[color=green]
          > > slawek wrote:
          > >[color=darkred]
          > >> I want to display a container which is maimum 300px width[/color]
          > >
          > >
          > > max-width: 300px;
          > >[color=darkred]
          > >> when there is more content in it - it displays scrollbars,[/color]
          > >
          > >
          > > Ugh. Horizontal scrollbars are terrible for accessibility.[/color]
          >
          > How so ?[/color]


          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.

          Comment

          • Lachlan Hunt

            #6
            Re: Making stylesheets (CSS) with self-adjusting height

            Matthias Gutfeldt wrote:[color=blue]
            > Brian wrote:[color=green]
            >> Ugh. Horizontal scrollbars are terrible for accessibility.[/color]
            >
            > How so ?[/color]

            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


            Please direct all spam to abuse@127.0.0.1
            Thank you.

            Comment

            • slawek

              #7
              Re: Making stylesheets (CSS) with self-adjusting height

              > ...[color=blue]
              > Note that this doesn't work in Internet Explorer...
              >[/color]

              I've found a way to do it in explorer.


              Thanx for all answers ;)


              Comment

              • Lachlan Hunt

                #8
                Re: Making stylesheets (CSS) with self-adjusting height

                slawek wrote:
                [color=blue]
                > I've found a way to do it in explorer.
                > http://www.svendtofte.com/code/max_width_in_ie/[/color]

                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.
                Gain technical skills through documentation and training, earn certifications and connect with the community

                [2] http://www.tantek.com/CSS/Examples/
                [3] http://dean.edwards.name/IE7/

                --
                Lachlan Hunt


                Please direct all spam to abuse@127.0.0.1
                Thank you.

                Comment

                • Andrew Thompson

                  #9
                  Re: Making stylesheets (CSS) with self-adjusting height

                  On Sat, 14 Aug 2004 14:36:20 GMT, Lachlan Hunt wrote:
                  [color=blue]
                  > ...I don't understand why IE has put in so
                  > much effort to implement proprietary technologies,
                  > while failing to implement standards.[/color]

                  ...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

                  Comment

                  Working...