Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
class order in TemplateProcessorHTML
#1
Dear all,
I have a strange render with css classes in an Intraweb application and I don't understand why, hope somebody can help me to fix it.
In a classic HTML/PHP page, when I assign 2 classes to an item, on rendering the classes are applied in the "text" order.

Here an example with a mix between bootstrap btn class and my own btn-welter class, the button is as expected.
[Image: html_d6b5io.png]

But with Intraweb, the same kind of button using the same classes is not properly render because my class is render before the bootstrap class.
[Image: intraweb_zprcsk.png]

I tried to reverse the classes order (btn-welter btn), but the render is the same.
Then I tried to use bootstrap classes only (btn btn-primary), and in this case the result is OK, I have a classic Bootstrap blue button.

I can't add !important in my class to force the render because it comes from a common class, and somethime we have to overwrite it by using a third class.

Any idea why my classes are not processed as expected ?

Many thanks for your help.
Reply
#2
Finally solved, in the header section of my template, I declared my stylesheet before the Bootstrap one.
I swapped the lines and now the render is OK.
Reply
#3
That's interesting. Either way it should work.

The styles should be applied in the exact order that they appear in the class definition of the object, regardless of the order that they appear in the file. Conflicting styles are always resolved from left to right, so a style of class btn is applied first, and then a conflicting style of the class btn-welter, if existing, is applied later, not the way around.

I've never seen a case such this before, to be honest and I don't think it should behave like this (and I don't think IW has anything to do with it either, it is a browser thing).
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)