Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Different behavior of tag SPAN under IE and FF

Reply
Thread Tools

Different behavior of tag SPAN under IE and FF

 
 
db
Guest
Posts: n/a
 
      11-28-2006
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

 
Reply With Quote
 
 
 
 
VK
Guest
Posts: n/a
 
      11-29-2006

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

 
Reply With Quote
 
 
 
 
ASM
Guest
Posts: n/a
 
      11-29-2006
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
 
Reply With Quote
 
db
Guest
Posts: n/a
 
      12-04-2006

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

 
Reply With Quote
 
db
Guest
Posts: n/a
 
      12-04-2006

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

 
Reply With Quote
 
ASM
Guest
Posts: n/a
 
      12-04-2006
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
 
Reply With Quote
 
db
Guest
Posts: n/a
 
      12-04-2006

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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
I'm looking for html cleaner. Example : convert <h1><span><font>my title</font></span></h1> => <h1>my title</h1>… Stéphane Klein Python 2 03-30-2010 12:35 AM
Re: I'm looking for html cleaner. Example : convert <h1><span><font>my title</font></span></h1> => <h1>my title</h1>… Stefan Behnel Python 0 03-29-2010 08:14 PM
Can span include span? Fulio Open HTML 5 06-26-2009 10:24 PM
how do u invoke Tag b's Tag Handler from within Tag a's tag Handler? shruds Java 1 01-27-2006 03:00 AM
Enable drag and drop to the text between <span></span> Wang, Jay Javascript 5 05-25-2004 09:33 PM



Advertisments