domo icon indicating copy to clipboard operation
domo copied to clipboard

Set style on element not working in IE8

Open kstubs opened this issue 13 years ago • 4 comments

This doesn't work, the style text-align "right" doesn't take:

        P({style:'text-align:right'},
            "maybe maybe maybe this works?")        

kstubs avatar Nov 19 '12 23:11 kstubs

weird... can you try adding a semicolon at the end of the style string?

jed avatar Nov 19 '12 23:11 jed

It's part of the HTML methods object, so can't. The whole thing looks like:

    HTML({lang: "en"},
        HEAD(
          STYLE({type: "text/css"},
            STYLE.on("body", {textAlign: "center", fontSize: 12, fontFamily:'Arial,Helvetica'}),
            STYLE.on("h1", opacity(50), {background: "#000", color: "#fff"})
          )
        ),

        BODY(H1("Welcome to domo"),
        P(O.x({id:'test'},styleLeft),
            "does this work?"),
        P({style:'text-align:right'},
            "maybe maybe maybe this works?")        
      ));

kstubs avatar Nov 19 '12 23:11 kstubs

i don't think i understand what's going on here... as long as text-align:right makes it into the style attribute of the P element, this problem is likely outside of domo's jurisdiction.

(also, what is 0.x?)

jed avatar Nov 20 '12 04:11 jed

O.x, is short for Object Extend. So it extends the object {id:'test'} to include the object defined by styleLeft. I haven't fully looked at your code but it would be convenient to be able to mix objects this way when calling any of your HTML5 methods. You can ignore that anyhow, the issue is in the next P method, the property style isn't making itself into the resulting document (IE of course). So give it a whirl, just take out the first P you see there and try in IE.

kstubs avatar Nov 20 '12 15:11 kstubs