Different behavior of tag SPAN under IE and FF

D

db

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
 
V

VK

db said:
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.
 
A

ASM

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

db

VK said:
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
 
D

db

ASM said:
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
 
A

ASM

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

db

ASM said:
db a écrit :

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

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,738
Latest member
JinaMacvit

Latest Threads

Top