CSS and Fonts in krpano? - krpano ignores (some) css

  • hi klaus,

    i noticed that when i do NOT use any font-family definitions in the xmls (skin_settings.design_text_css)
    that i can set the font globally in the index.html by css.

    strange thing that this works when using certain elements (green), but then doesn't for others (red)....

    h1 { font-family:'Akkurat Light Pro',sans-serif; } with textfield : html="[h1]my font[/h1]"
    span { font-family:'Akkurat Light Pro',sans-serif; } with textfield : html="[span]my font[/span]"

    html { font-family:'Akkurat Light Pro',sans-serif; } with textfield : html="my font"
    body { font-family:'Akkurat Light Pro',sans-serif; } with textfield : html="my font"
    p { font-family:'Akkurat Light Pro',sans-serif; } with textfield : html="[p]my font[/p]"

    .test { font-family:'Akkurat Light Pro',sans-serif; } with textfield : [p class='test']my font[/p]

    it seems to me that krpano does ignore the styles on body/html and also ignores styles on <p>
    although <p> works then again when you're using a class...

    hm, just wanna report this... I found my way around it by now,
    but it would be nice to know if that behaviour is intended... ?

    index

  • Hi,

    that's not intended to work at all...

    Yes, it html it's possible to overwrite the CSS declaration of the default elements, but that doesn't mean the krpano and textfield plugin automatically internally is based on that or intended to work this.

    E.g. a <p> element is not a <p> element after parsing anymore and the whole textfield content itself is within several other html elements with own default styles.

    If you really want to assign styles this way better only use <span> and <div> and classes (or custom html element names) - and keep in mind that would work only for the HTML5 viewer, and not for the Flash viewer of course.

    Best regards,
    Klaus

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!