473,320 Members | 1,600 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

display:block problem in Opera

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
18 5589
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
"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
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
"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
"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
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

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


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
"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
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
> 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
"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
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
>>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
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Jeff Thies | last post by:
I'm trying to do a nav list using list items. Roughly this is putting links styled display: block and with a background color. In IE5 (windows, haven't tried Mac yet), adding the display:...
7
by: Marc | last post by:
Hi everyone. I am having trouble with a stylesheet in mozilla. It is part of turning a list into a menu: #menu li{ margin: 0; display: inline; vertical-align: bottom;
6
by: Sandman | last post by:
I'm having some problem here... I have a javascript I've downloaded that goes through all PNG files and enables the transparency channel in them for IE5.5+ by converting them to SPAN layers with...
6
by: dee | last post by:
Here is a a list of my hyperlinks in my home page: <A class="theclass" href="Default.aspx">Home</A> <A class="theclass" href="Search.aspx">Search</A> <A class="theclass"...
2
by: ruby_bestcoder | last post by:
Hi Im having problem in firefox with display:none/block. I have essentially 3 li elements. In each element there are a few nested div:s. Clicking on one of the divs, makes another div to...
25
by: Dave | last post by:
Hello. In trying to get an anchor element to stylistically match an input or button element, I find that the button and input cannot be styled according to the 2.1 CSS spec. For example, I...
7
by: Janis | last post by:
I try to understand what could be the source of a problem with displaying and hiding rows of tables using display:block/none. I've read selfhtml but could not find any hint about that. Any...
3
by: Chandra | last post by:
Hi All, I have 2 htmls with one being referred in iframe of the other. The iframe html has style display = block and none set in the javascript. however this makes the block go behind the parent...
3
by: WSPL5 | last post by:
I have a hidden span within a table column and I cannot unhide it using style.display='block' ?? Sample code <table> <tr> <td><input name="status" value=""></td><td><input type="button"...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.