Custom UI node - layout problems

try setting it via style instead of width and height - eg
... style="width:100%; height:100%;" ...
gives me

Hi Dave (@dceejay),

Thanks a lot!!! That indeed works fine.
Don't understand why the CSS width and height work, and the DOM element width and height not. But anyway, I'm glad that you keep hanging around to answer our questions ...

1 Like

a div does not have width, height attributes

to be a bit more elaborate, a DOM node is a javascript object and something that is drawn by the browser. As a javascript object, it can have properties, just as a normal object. These can be set via javascript as normal. An attribute is something that you set in the html tag of that DOM node. Some of these attributes correspond directly to properties, some not (super strange first, but it also somehow makes sense). You can also set attributes via javascript by setAttribute().

A canvas has width and height attributes (and properties), a div not. Both have style attributes where you can define width and height as CSS. The div has a property clientHeight, which gives you the height in javascript

3 Likes

Ah, I haven't even checked that ...
OMG, and now you have informed the whole planet that I don't know this kind of stuff :joy:

1 Like

wasn't my intention, my apologies :slight_smile:

1 Like