Different behavior of tag SPAN under IE and FF

Discussion in 'Javascript' started by db, Nov 28, 2006.

  1. db

    db Guest

    Hello @ all,

    I got a problem regarding tag SPAN. Under IE, all text within tag SPAN
    will be centralized, whereas under FF the text stays on the left.

    The correponding HTML code is
    <span class="c_normal">Some text here.......</span>

    the style class c_normal is defined as:
    ..c_normal {
    clear: left;
    text-align: justify;
    line-height: 150%;
    font-size: 11pt;
    font-family: Arial;
    margin:0px;
    }

    Furthermore, there is an another weird problem:
    When i changed the style.css file, the page which uses the style.css
    does not change at all under IE, whereas the page under firefox will
    change correspondingly.
    For example: if i change e.g font-size to 50pt, the page under firefox
    will change correspondingly, but the page under IE keeps the same after
    refresh. I dont know why this happens.

    Can somebody help me? Thanks!

    db
     
    db, Nov 28, 2006
    #1
    1. Advertising

  2. db

    VK Guest

    db wrote:
    > Hello @ all,
    >
    > I got a problem regarding tag SPAN. Under IE, all text within tag SPAN
    > will be centralized, whereas under FF the text stays on the left.
    >
    > The correponding HTML code is
    > <span class="c_normal">Some text here.......</span>
    >
    > the style class c_normal is defined as:
    > .c_normal {
    > clear: left;
    > text-align: justify;
    > line-height: 150%;
    > font-size: 11pt;
    > font-family: Arial;
    > margin:0px;
    > }
    >
    > Furthermore, there is an another weird problem:

    <snip>

    Ask at <comp.infosystems.www.authoring.stylesheets> : and be ready for
    questions (of different degree of nastiness) why are you using span as
    block element. As an elementary precaution :) I would change it to div
    first, see if the problems persist and then go to the indicated
    newsgroup.

    --
    "Give to Caesar what is Caesar's, and to God what is God's."
     
    VK, Nov 29, 2006
    #2
    1. Advertising

  3. db

    ASM Guest

    Re: [CSS] Different behavior of tag SPAN under IE and FF

    db a écrit :
    > Hello @ all,
    >
    > I got a problem regarding tag SPAN. Under IE, all text within tag SPAN
    > will be centralized, whereas under FF the text stays on the left.


    How can you have text centered while you ask to have it justified ?
    text-align: justify;
    means fill up the line (when it's possible)

    By otherway the tag span gan't get a width, so text can't be centered in it.
    If you want a span centered in a line (a P or a DIV) it is this
    container which has to be styled in center (see also below).

    About IE, possible it doesn't refresh external styles sheet.
    Ask to him to open this *.css to force it to refresh
    then open your page (don't go back)

    > <span class="c_normal">Some text here.......</span>
    >
    > the style class c_normal is defined as:
    > .c_normal {
    > clear: left;
    > text-align: justify;
    > line-height: 150%;
    > font-size: 11pt;
    > font-family: Arial;
    > margin:0px;


    to center this element --> margin: auto;

    > }




    --
    Stephane Moriaux et son moins vieux Mac déjà dépassé
    Stephane Moriaux and his less old Mac already out of date
     
    ASM, Nov 29, 2006
    #3
  4. db

    db Guest

    VK schrieb:

    > Ask at <comp.infosystems.www.authoring.stylesheets> : and be ready for
    > questions (of different degree of nastiness) why are you using span as
    > block element. As an elementary precaution :) I would change it to div
    > first, see if the problems persist and then go to the indicated
    > newsgroup.
    >



    Thanks for reply. I have tried <div> or <p> before i posted the thread.
    It did work. But the problem is i use a plugin(Tinymce) to generate the
    online word-like editor, the plugin just uses <span> tag, i cannot
    change the source code.

    With using <span> tag the FF keeps the text left, which is what i want,
    but IE keeps the text centered. I would like to know how to let the
    text in IE stay left like in FF, instead of centered without touching
    the source code.

    db
     
    db, Dec 4, 2006
    #4
  5. db

    db Guest

    ASM schrieb:
    > How can you have text centered while you ask to have it justified ?
    > text-align: justify;
    > means fill up the line (when it's possible)
    >
    > By otherway the tag span gan't get a width, so text can't be centered in it.
    > If you want a span centered in a line (a P or a DIV) it is this
    > container which has to be styled in center (see also below).
    >
    > About IE, possible it doesn't refresh external styles sheet.
    > Ask to him to open this *.css to force it to refresh
    > then open your page (don't go back)


    > to center this element --> margin: auto;


    Hi, thank you for the reply.

    I also tried with text-align:left. It doesnt work neighther. T_T
    With using span, the text in IE is centered, in FF not. Actually i want
    the text to stay in left, not centered.

    I tried with your second advice, it doesnt work also......

    thanks anyway

    db
     
    db, Dec 4, 2006
    #5
  6. db

    ASM Guest

    db a écrit :
    > I also tried with text-align:left. It doesnt work neighther. T_T
    > With using span, the text in IE is centered, in FF not. Actually i want
    > the text to stay in left, not centered.
    >
    > I tried with your second advice, it doesnt work also......


    Once more : 'span' is of style "inline" so you can separate it fron its
    context, that's to say its container "P".
    If P is aligned to right, spam follows movement

    The only thing I think you can do is to modify this span in block

    ..c_normal {
    clear: left;
    display: block;
    margin:0px;
    /* to center the span
    width: 200px;
    margin: auto;
    */
    text-align: left;
    font-size: 11pt;
    line-height: 150%;
    font-family: Arial;
    border:1px solid red;
    }


    <p style="text-align: right">some text to fill ...
    <span class="c_normal">Some text here.......</span>
    rest of filling text.
    </p>

    --
    Stephane Moriaux et son (moins) vieux Mac déjà dépassé
    Stephane Moriaux and his (less) old Mac already out of date
    Contact : http://stephane.moriaux.perso.wanadoo.fr/contact
    ASM = Aimable Stéphane Moriaux = Amateur Sasseur Merdouilles
     
    ASM, Dec 4, 2006
    #6
  7. db

    db Guest

    ASM schrieb:

    > db a écrit :
    > > I also tried with text-align:left. It doesnt work neighther. T_T
    > > With using span, the text in IE is centered, in FF not. Actually i want
    > > the text to stay in left, not centered.
    > >
    > > I tried with your second advice, it doesnt work also......

    >
    > Once more : 'span' is of style "inline" so you can separate it fron its
    > context, that's to say its container "P".
    > If P is aligned to right, spam follows movement
    >
    > The only thing I think you can do is to modify this span in block
    >
    > .c_normal {
    > clear: left;
    > display: block;
    > margin:0px;
    > /* to center the span
    > width: 200px;
    > margin: auto;
    > */
    > text-align: left;
    > font-size: 11pt;
    > line-height: 150%;
    > font-family: Arial;
    > border:1px solid red;
    > }
    >
    > > ASM = Aimable Stéphane Moriaux = Amateur Sasseur Merdouilles


    Thanks a lot!

    display: block; does the magic!

    And for my second question: why IE does not take the stylesheet, i have
    also found the reason. One has to delete all buffer data for IE,
    otherwise IE will alway use the first stylesheet it downloaded.....
    Thats stupid -.-!!

    db
     
    db, Dec 4, 2006
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. shruds
    Replies:
    1
    Views:
    870
    John C. Bollinger
    Jan 27, 2006
  2. Fulio Open

    Can span include span?

    Fulio Open, Jun 26, 2009, in forum: HTML
    Replies:
    5
    Views:
    559
    dorayme
    Jun 26, 2009
  3. Stéphane Klein
    Replies:
    2
    Views:
    1,801
    John Nagle
    Mar 30, 2010
  4. Stefan Behnel
    Replies:
    0
    Views:
    492
    Stefan Behnel
    Mar 29, 2010
  5. Wang, Jay
    Replies:
    5
    Views:
    483
    Wang, Jay
    May 25, 2004
Loading...

Share This Page