By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,275 Members | 1,031 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,275 IT Pros & Developers. It's quick & easy.

display:block problem in Opera

P: n/a
G'day.

Is there a known "display:block;" problem in opera?

In playing around trying to get some cross browser conformance, I either
inadvertently or redundantly (depending on your perspective) added
"display:block;" to a style defining tables that also had zero padding, margin
and border.

With "xdisplay:block;" (that is nothing) all browsers (well Ie6, MZ, Ff Op in
Win2k) showed the table as expected. When "display:block;" is set the tables in
Opera only, have a 1 or 2 px border added to the cells.

I cannot tell you how long it took me to notice this... in fact I gave up on
opera as being seriously broken, rather than some redundancy in my code.

In case I am not being very clear the examples below should show the problem:
(nb the problem ONLY occurs in Opera.)

http://www.netwiz.com.au/opera/operagood.html

and with display:block; munged out to xdisplay:block;

http://www.netwiz.com.au/opera/operagood.html

regards DM
----------------------------------------------------------------
David Morris
http://www.netwiz.com.au/
Perth Western Australia
Jul 20 '05 #1
Share this Question
Share on Google+
18 Replies


P: n/a
oops, that should read:

http://www.netwiz.com.au/opera/operagood.html

and with display:block; munged out to xdisplay:block;

http://www.netwiz.com.au/opera/operabad.html

Jul 20 '05 #2

P: n/a
"David Morris"
<DONTSPAMdlmorris-ATDONTSPAMATnetwiz-com-au@don't.use.this.bit> wrote:
With "xdisplay:block;" (that is nothing) all browsers (well Ie6, MZ, Ff Op in
Win2k) showed the table as expected. When "display:block;" is set the tables in
Opera only, have a 1 or 2 px border added to the cells.


If you want a table element to be rendered as a table then it should be
set to display:table, since this is the default it's superfluous.

Setting the table element (or tr/td) to display:block will change the
element to behave like for example a div.

Other UAs don't handle this correctly, Opera does.

--
Spartanicus
Jul 20 '05 #3

P: n/a
If you want a table element to be rendered as a table then it should be
set to display:table, since this is the default it's superfluous.

Setting the table element (or tr/td) to display:block will change the
element to behave like for example a div.

Other UAs don't handle this correctly, Opera does.


In this case it was superfluous anyway (see http://www.netwiz.com.au/home.html)
, but why is adding a border, when the style sets the borders to 0px, the
correct way of doing it?

Jul 20 '05 #4

P: n/a
"David Morris"
<DONTSPAMdlmorris-ATDONTSPAMATnetwiz-com-au@don't.use.this.bit> wrote:
If you want a table element to be rendered as a table then it should be
set to display:table, since this is the default it's superfluous.

Setting the table element (or tr/td) to display:block will change the
element to behave like for example a div.

Other UAs don't handle this correctly, Opera does.


In this case it was superfluous anyway (see http://www.netwiz.com.au/home.html)
, but why is adding a border, when the style sets the borders to 0px, the
correct way of doing it?


You're not making any sense, what do borders have to do with this? And
why did you set display:block on the table/tr/td elements in the first
place?

--
Spartanicus
Jul 20 '05 #5

P: n/a
"David Morris"
<DONTSPAMdlmorris-ATDONTSPAMATnetwiz-com-au@don't.use.this.bit> wrote:
In this case it was superfluous anyway (see http://www.netwiz.com.au/home.html)


Btw, the stylesheet used there is packed with superfluous code.

I hope you didn't actually write that yourself, if you did then you
really need to learn css, start here: http://w3.org

If this was generated by a tool, ditch it.

--
Spartanicus
Jul 20 '05 #6

P: n/a
You're not making any sense, what do borders have to do with this? And
why did you set display:block on the table/tr/td elements in the first
place?

Well... ....because the display of borders IS the problem. Try viewing
http://www.netwiz.com.au/opera/operabad.html in any other browser.

Why I had it there is the first place was because I was trying all sorts of
things to get the borders to behave the same way mostly because of the
differing box model problem - these where problems between ie and mz, which I
eventually solved. I was also trying to limit my self to "css1", so I didn't
think of display:table;, but in any case we can both agree my use of it was
either wrong or redundant.

My point is that it should NOT affect the borders, regardless of whether my use
was right or wrong. At worst it should just be ignored.

Jul 20 '05 #7

P: n/a

"Spartanicus" <me@privacy.net> wrote in message
news:6u********************************@news.spart anicus.utvinternet.ie...
"David Morris"
<DONTSPAMdlmorris-ATDONTSPAMATnetwiz-com-au@don't.use.this.bit> wrote:
In this case it was superfluous anyway (see
http://www.netwiz.com.au/home.html)
Btw, the stylesheet used there is packed with superfluous code.

I hope you didn't actually write that yourself, if you did then you
really need to learn css, start here: http://w3.org


I probably have lots to learn,... however, the central panel was generated by a
tool, which also produces the external stylesheet used by the rest of the pages
on the site. I agree, that there are lots of redundant aspects to their
stylesheet, but I have to tell you that for single source production of html,
help, htmlhelp, word, javahelp and the rest, Authorit! is unbeatable. So it
is trade of between speed and useability for me. See
http://www.author-it.com/. I have made considerable modifications to their
output, so see also: http://www.netwiz.com.au/tools_for_authorit.html.
Jul 20 '05 #8

P: n/a
> I probably have lots to learn,... however, the central panel was generated by
a
tool, which also produces the external stylesheet used by the rest of the pages on the site. I agree, that there are lots of redundant aspects to their
stylesheet, but I have to tell you that for single source production of html,
help, htmlhelp, word, javahelp and the rest, Authorit! is unbeatable. So it
is trade of between speed and useability for me. See
http://www.author-it.com/. I have made considerable modifications to their
output, so see also: http://www.netwiz.com.au/tools_for_authorit.html.


Oh, and I should add, the buttons down the left panel are all mine, and all
pure CSS! http://www.netwiz.com.au/home.html
Jul 20 '05 #9

P: n/a
"David Morris"
<DONTSPAMdlmorris-ATDONTSPAMATnetwiz-com-au@don't.use.this.bit> wrote:
I hope you didn't actually write that yourself, if you did then you
really need to learn css, start here: http://w3.org


I probably have lots to learn,... however, the central panel was generated by a
tool, which also produces the external stylesheet used by the rest of the pages
on the site. I agree, that there are lots of redundant aspects to their
stylesheet, but I have to tell you that for single source production of html,
help, htmlhelp, word, javahelp and the rest, Authorit! is unbeatable.


If crap CSS is what you're after then Authorit! seems to be the perfect
tool alright.

Good luck with it, and stop complaining when a proper browser like Opera
actually executes the CSS as it should.

--
Spartanicus
Jul 20 '05 #10

P: n/a
> Good luck with it, and stop complaining when a proper browser like Opera
actually executes the CSS as it should.


I think you have failed to understand the problem. AuthorIt has NOTHING to do
with this problem, and http://www.netwiz.com.au/opera/operagood.html which
shows it, is hand coded in Notepad.

Do you have something to do with Opera? ... you seem unnaturally defensive.
Jul 20 '05 #11

P: n/a


I think you have failed to understand the problem. AuthorIt has NOTHING to do with this problem, and http://www.netwiz.com.au/opera/operagood.html which
shows it, is hand coded in Notepad.

Do you have something to do with Opera? ... you seem unnaturally defensive.


Oops again, that should be http://www.netwiz.com.au/opera/operabad.html.
Jul 20 '05 #12

P: n/a
"David Morris"
<DONTSPAMdlmorris-ATDONTSPAMATnetwiz-com-au@don't.use.this.bit> wrote:
Good luck with it, and stop complaining when a proper browser like Opera
actually executes the CSS as it should.


I think you have failed to understand the problem.


I think you've failed to understand html and css, start here:
http://validator.w3.org/check?uri=ht.../operabad.html
http://jigsaw.w3.org/css-validator/v...usermedium=all

--
Spartanicus
Jul 20 '05 #13

P: n/a
David Morris wrote:
Well... ....because the display of borders IS the problem.
Firstly, take a look at the CSS2 tables module [1]. In particular, you
should really understand 17.2.1 Anonamous table objects [2], 17.6.1 The
separated borders model [3] and 17.6.2 The collapsing border model [4].
My point is that it should NOT affect the borders, regardless of whether my use
was right or wrong. At worst it should just be ignored.


It certainly should not be ignored, as you will see when you understand
17.2.1, setting an table element (table, tr or td) to a different
display value, then the appropriate table, row and/or cell elements will
be generated in the display to fill in the gaps. (it can get slightly
more complicated then that, but it is the general idea of how it works).
Combine that with the various border styles and algorithms, I think,
explains why Opera is not doing as you expect. In general, although
there are plenty of bugs in all browsers, Opera does tend to do things
correctly.

[1] http://www.w3.org/TR/CSS2/tables.html
[2] http://www.w3.org/TR/CSS2/tables.html#anonymous-boxes
[3] http://www.w3.org/TR/CSS2/tables.html#separated-borders
[4] http://www.w3.org/TR/CSS2/tables.htm...apsing-borders
--
Lachlan Hunt
http://www.lachy.id.au/

Please direct all spam to ab***@127.0.0.1
Thank you.
Jul 20 '05 #14

P: n/a
> I think you've failed to understand html and css, start here:
http://validator.w3.org/check?uri=ht.../operabad.html
http://jigsaw.w3.org/css-validator/v...usermedium=all


Sure I have made some mistakes in the quick and dirty example given, but, as
you know, or should know this does not change anything. Your focus seems to
be on me not being able to doing something (anything?) which I am happy to
admit, but I am only asking one question...

Is there a known problem "display:block;" problem in opera?

I get the feeling that you (at least) perceive your self as an expert. As a
non expert in css I would have more respect for your abilities if you focused
on the issue I raised, rather than flagging anything/everything else. I trust
you are not "trolling", but that is how it is bringing to seem from my end.
Why are you so sensitive about this?

Anyhow, to avoid any confusion or avoid offending any sensibilities I have
fixed the code to the standard required by the HTML validator, which should
make it clear that your other issues are not the cause of problem:
http://www.netwiz.com.au/opera/operabad.html.

I have also tried to use the W3C CSS Validator to check it, but the validator
seems to find my 404 error, and not the correct page.

(I have deleted http://www.netwiz.com.au/opera/operagood.html to save any more
confusion).
Jul 20 '05 #15

P: n/a
"David Morris" <DONTSPAMdlmorris-ATDONTSPAM-netwiz-com-au
-@don't.use.this.bit> wrote:
I am only asking one question...

Is there a known problem "display:block;" problem in opera?
Why are you still whining on about this? You've been given the answer:
don't set table/tr/td to display:block. Unlike other browsers Opera
carries out your instruction: you get what you ask for.
I have also tried to use the W3C CSS Validator to check it, but the validator
seems to find my 404 error, and not the correct page.


uri's in html documents are relative to the directory that the html
document is in, there is no:
http://www.netwiz.com.au/opera/stylesheet.css there is a:
http://www.netwiz.com.au/stylesheet.css

Since your 404 contains in-document styles, some UAs may parse it.

--
Spartanicus
Jul 20 '05 #16

P: n/a
It certainly should not be ignored, as you will see when you understand
17.2.1, setting an table element (table, tr or td) to a different display
value, then the appropriate table, row and/or cell elements will be generated
in the display to fill in the gaps. (it can get slightly
I have had a read of the spec in the areas you suggested, and what you suggest
makes sence. I guess what is happening is that opera is creating an
"anonymous object" and that object is defaulting to 1 pixel border (or
whatever).
explains why Opera is not doing as you expect. In general, although there
are plenty of bugs in all browsers, Opera does tend to do things correctly.


Yes, I had heard that which is why I was surprised. Having said that (and I'll
admit I may not have understood everything in that part of the spec - I have
only skimmed it so far), it still seems strange to me that it would
gratuitously insert that object only when specifying "display:block;" , rather
than when the border, padding and margin entries are missing.

The spec does say "HTML user agents are not required to create anonymous
objects according to the above rules.", which suggests that there isn't really
a spec here. Therefore, I would have thought the most obvious result would
have been to display the other elements of the style sheet, rather than to
ignore them. My suspicion is that the effect is not an intended one, but
rather an accidental effect, which has not been noticed before because it is (I
assume) redundant to say display:block;" for a table. But that is just a
suspicion, and I guess I am really just asking the question.


Jul 20 '05 #17

P: n/a
>>Is there a known problem "display:block;" problem in opera?

Why are you still whining on about this? You've been given the answer:
don't set table/tr/td to display:block. Unlike other browsers Opera
carries out your instruction: you get what you ask for.
Don't tell me I am whining, when I am clearly not. Your assumptions about
Opera are just opinions, see other posts above - the specs are ambiguous here.
And, I wasn't told how to fix the problem, I had fixed it by removing my
redundant "table:block;" in the fist place. I just wanted to know if this was
a problem that was well known. Obviously you hadn't heard about it.
document is in, there is no:
http://www.netwiz.com.au/opera/stylesheet.css there is a:
http://www.netwiz.com.au/stylesheet.css

Fixed now by removing it. It was redundant for this demo.
Jul 20 '05 #18

P: n/a
"David Morris" <DONTSPAMdlmorris-ATDONTSPAM-netwiz-com-au
-@don't.use.this.bit> wrote:
Your assumptions about
Opera are just opinions, see other posts above - the specs are ambiguous here.


Nope, you simply don't understand them.

--
Spartanicus
Jul 20 '05 #19

This discussion thread is closed

Replies have been disabled for this discussion.