linked stylesheet strange behavior

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • aamirghanchi@yahoo.com

    linked stylesheet strange behavior

    Hi,

    I have a very simple html that has a linked stylesheet. According to
    the style sheet both blocks of text should be displayed in the font
    xx-small. but only one (DIV or SPAN) at a time is displayed in this
    font and that would be the one that is at the end of the stylesheet
    file. for example if DIV selector is the last block in MyStylesheet.cs s
    then the corresponding text in the DIV tag in the html will be small
    font. If we swap the spaces of div and span in the styleshet then the
    corresponding tag in the span tag in the html will be small
    _______________ _______________ _______________ ___
    MyStylesheet.cs s
    /*************** */
    <style>

    span {
    font-size : xx-small;
    }
    div {
    font-size : xx-small;
    }
    </style>

    _______________ _______________ _______________ ____
    Test.htm
    <!------------->
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html>
    <head>
    <link rel="stylesheet " type="text/css" href="HighResol ution.css" />

    <title>test.htm </title>

    </head>

    <body>

    <div>this text is in DIV</div>
    <span>this text is in SPAN</span>


    </body>
    </html>

  • Beauregard T. Shagnasty

    #2
    Re: linked stylesheet strange behavior

    In comp.infosystem s.www.authoring.stylesheets, aamirghanchi@ya hoo.com
    wrote:[color=blue]
    > Hi,
    >
    > I have a very simple html that has a linked stylesheet. According to
    > the style sheet both blocks of text should be displayed in the font
    > xx-small. but only one (DIV or SPAN) at a time is displayed in this
    > font and that would be the one that is at the end of the stylesheet
    > file. for example if DIV selector is the last block in MyStylesheet.cs s
    > then the corresponding text in the DIV tag in the html will be small
    > font. If we swap the spaces of div and span in the styleshet then the
    > corresponding tag in the span tag in the html will be small
    > _______________ _______________ _______________ ___
    > MyStylesheet.cs s
    > /*************** */
    > <style>[/color]

    The above <style> and the </style> must be removed from your
    stylesheet. The validator would have told you this.
    [color=blue]
    > span {
    > font-size : xx-small;
    > }
    > div {
    > font-size : xx-small;
    > }[/color]

    Consider using percentages instead of keywords for sizing. Some
    browsers do not recognize them. For example:
    span.small { font-size: 80%; }
    [color=blue]
    > </style>
    >
    > _______________ _______________ _______________ ____
    > Test.htm
    > <!------------->[/color]

    You don't want the above line in your HTML.
    [color=blue]
    > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    > <html>
    > <head>
    > <link rel="stylesheet " type="text/css" href="HighResol ution.css" />
    >
    > <title>test.htm </title>
    >
    > </head>
    >
    > <body>
    >
    > <div>this text is in DIV</div>
    > <span>this text is in SPAN</span>[/color]

    A <span> is an inline element, should not be a child of <body> but
    should be within a <div> or a <p> or other block-level element.
    [color=blue]
    > </body>
    > </html>[/color]

    Post a URL to your problem page.

    --
    -bts
    -This space intentionally left blank.

    Comment

    • kchayka

      #3
      Re: linked stylesheet strange behavior

      aamirghanchi@ya hoo.com wrote:[color=blue]
      >
      > div {
      > font-size : xx-small;
      >
      > <link rel="stylesheet " type="text/css" href="HighResol ution.css" />[/color]

      I find it rather ironic that you are using such a teensy font-size for a
      "high resolution" stylesheet. I take it you don't want your visitors to
      be able to read it, eh? ;)

      --
      Reply email address is a bottomless spam bucket.
      Please reply to the group so everyone can share.

      Comment

      • aamirghanchi@yahoo.com

        #4
        Re: linked stylesheet strange behavior

        Hi Beauregard,
        [color=blue]
        >...The validator would have told you this.[/color]
        the problem was indeed the <style> tags in the css file. Sorry no
        validator ...I am using notepad.
        [color=blue]
        >... Some browsers do not recognize them[/color]
        This web app is targetted for an intranet app and our staff use only
        one browser type.
        [color=blue]
        >...You don't want the above line in your HTML[/color]
        I created this example on the fly. It is a very simple example of a
        complex page.
        [color=blue]
        >... <span> is an inline element, should not be a child of <body ...[/color]
        Thanks for shaing this. Is it in w3c specs

        Thanks for your help.

        Aamir

        Comment

        • aamirghanchi@yahoo.com

          #5
          Re: linked stylesheet strange behavior

          Thanks for correction. Should have been LowResolution.c ss

          Comment

          • Beauregard T. Shagnasty

            #6
            Re: linked stylesheet strange behavior

            In c.i.w.a.s, aamirghanchi@ya hoo.com wrote:[color=blue]
            > Hi Beauregard,[/color]

            Good morning.
            [color=blue][color=green]
            >> ...The validator would have told you this.[/color]
            >
            > the problem was indeed the <style> tags in the css file. Sorry no
            > validator ...I am using notepad.[/color]

            http://www.htmlhelp.com/tools/csscheck/ Copy your file into the
            proper text box. Your choice of editor doesn't matter.
            [color=blue][color=green]
            >> ... [size words] Some browsers do not recognize them[/color]
            >
            > This web app is targetted for an intranet app and our staff use
            > only one browser type.[/color]

            Still ... it pays to use good habits all the time. Oh, in future, be
            sure to state if your question is not for www.
            [color=blue][color=green]
            >> ...You don't want the above line in your HTML[/color]
            >
            > I created this example on the fly. It is a very simple example of a
            > complex page.[/color]

            This is why it is always a good idea to post your problem page on a
            server somewhere, so we can see a working example, with some sort of
            content.

            <sniprest>
            --
            -bts
            -This space intentionally left blank.

            Comment

            Working...