#11536 closed defect (invalid)
dojo.create: the style attribute seems to be ignored by Internet Explorer 7
Reported by: | scheid | Owned by: | anonymous |
---|---|---|---|
Priority: | high | Milestone: | tbd |
Component: | HTML | Version: | 1.5 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
When I use dojo.create and include a style attribute, like this:
div2 = dojo.create("div", {style:"white-space: nowrap;margin-left:12px;font-size:8pt;"}, td);
then all of the style values get ignored in IE 7 (I have not tested other IE versions). The above code works great in Firefox.
I have done a workaround; when I pull out the styles and use dojo.style, like this:
div2 = dojo.create("div", {}, td); dojo.style(div2, "whiteSpace", "nowrap") dojo.style(div2, "marginLeft", "12px"); dojo.style(div2, "fontSize", "8pt");
then it renders correctly in IE. I can do the workaround, but this dojo.create issue in IE seems like an bug.
Change History (2)
comment:1 Changed 12 years ago by
Component: | General → HTML |
---|---|
Resolution: | → invalid |
Status: | new → closed |
comment:2 Changed 12 years ago by
OK, thanks for the info. I missed that.
Still though, it seems that to be consistent, we should be able to pass in a style string just as we would in an HTML tag. dojo.create handles all other attributes (e.g., id, src, href, etc.) that way, I believe.
Note: See
TracTickets for help on using
tickets.
You need to pass in a property bag. (The API guide for dojo.create() refers to dojo.attr() which explains this.)