comportement étrange avec css

Accueil Forums Programmation WIMS Programmation d’exercices OEF comportement étrange avec css

Vous lisez 11 fils de discussion
  • Auteur
    Messages
    • #1513
      kelh
      Participant
      Up
      0
      Down
      ::

      Bonjour,
      je ne comprends pas pourquoi les codes suivants donnent des affichages différents.

      \statement{
      <p style="background-color:black; color:white; padding:2px 2px 2px 2px; display:table;">
      \(X)=\embed{r1}
      </p>
      }
      \answer{}{1}{type=numeric}
      \statement{
      <p style="background-color:black; color:white; padding:2px 2px 2px 2px; display:table;">
      \(x)=\embed{r1}
      </p>
      }
      \answer{}{1}{type=numeric}

      Merci pour vos réponses.

    • #1515
      bernadette
      Maître des clés
      Up
      0
      Down
      ::

      Bonjour

      Différents en quoi ?
      Sinon, il faut faire attention avec les tables quand il y a du code mathml à l’intérieur, il arrive qu’il y ait un passage à la ligne et je ne sais pas pourqoi.

      Bernadett

    • #1516
      kelh
      Participant
      Up
      0
      Down
      ::

      Différents en quoi ?

      c’est le passage à la ligne dans le premier cas (qui est gênant) et pas dans le deuxième cas et pourtant la seule différence entre les codes est le changement de X en x.

    • #1517
      bernadette
      Maître des clés
      Up
      0
      Down
      ::

      J’avais le passage à la ligne dans les deux cas ! Le changement est un changement de taille (X / x ). Il y a ce problème pour les expressions Mathml dans une table (ce qui est le cas ici puisque tu demandes display:table). Je ne sais pas pourquoi et comment corriger (sauf à ne pas utiliser de table).
      le même problème se produit dans les réponses non « embed » car dans le noyau de wims, elles sont dans des tables. Je n’ai pas encore changé car cela a un impact à beaucoup d’endroits.

      Une « solution » peu satisfaisante est d’imposer un minimum de largeur. Si quelqu’un a une solution plus universelle, je suis aussi preneur.
      Bernadette

    • #1518
      jm.evers
      Participant
      Up
      0
      Down
      ::

      Hi,
      The solution is simple and straight forward : just use a normal table !! although some « experts » regard the use of a « table » a sign of incompetence (…) and insist of using highly complex and extremely large CSS-style sheets to do very very simple things

      kind regards,
      Joke

    • #1519
      bernadette
      Maître des clés
      Up
      0
      Down
      ::

      A normal table has exactly the same problem. I saw it in oef exercises
      where the answer is given in a table : In fact exactly the example !
      (it is perhaps a bog of the browser, here firefox. Does not occur with safari,
      on chrome, there is no mathml).

      \statement{
      <table><tr><td>\(x+1/2\)
      =\embed{r1}</td></tr>
      </table>
      }
      \answer{}{1/2}{type=numeric}

      The source is

      <table><tr><td>
      <math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mstyle id="wims_mathml242463" mathsize="120%"><mi>x</mi><mo>+</mo><mstyle displaystyle="true"><mfrac><mrow><mn>1</mn></mrow><mrow><mn>2</mn></mrow></mfrac></mstyle></mstyle></math>	= 
      <input size="20" name="reply1" value=""  />
      </td></tr>	</table>	
      
      <table><tr><td>
      <math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mstyle id="wims_mathml944784" mathsize="120%"><mi>x</mi><mo>+</mo><mn>5</mn><mo>+</mo><mstyle displaystyle="true"><mfrac><mrow><mn>1</mn></mrow><mrow><mn>2</mn></mrow></mfrac></mstyle></mstyle></math>	= 
      
      <input size="20" name="reply1" value=""  />
      
      </td></tr>	</table>	
      
    • #1521
      bernadette
      Maître des clés
      Up
      0
      Down
      ::

      Opera ne semble pas avoir ce bogue non plus.
      Mon point de vue est qu’il ne vaut mieux pas « trafiquer » pour que cela fonctionne comme on voudrait pour un navigateur car cela risque ensuite d’être pire
      J’ai essayé le code précédent dans une page html (indépendante de wims) et
      le problème est le même.

      Bernadette

      A propos, pour Mathml, il semble y avoir des avancées puis des reculs :

      http://caniuse.com/mathml

      • Cette réponse a été modifiée le il y a 10 années et 10 mois par bernadette.
    • #1523
      jm.evers
      Participant
      Up
      0
      Down
      ::

      This works just fine on my system using « Mozilla Firefox 20.0 » and « Opera 12.12 Build 1707 » and « Mozilla SeaMonkey 2.6.1″

      \statement{
      <table style= »background-color:black; color:white;
      padding:2px 2px 2px 2px » >
      <tr>
      <th>
      \(\frac{1}{2} \cdot x )
      </th>
      <th>
      =
      \embed{r1}
      </th>
      </tr>
      </table>
      }
      \answer{}{1}{type=numeric}

    • #1524
      jm.evers
      Participant
      Up
      0
      Down
      ::

      Forgotten to include a


      « proof »
      image of the oef-code
      joke

    • #1525
      bernadette
      Maître des clés
      Up
      0
      Down
      ::

      So it is dependant on the browser, the system or the version. Not on the way to use the table (as css or normally). It is exactly what I wanted to emphasize !

      Kind regards
      bernadette

    • #1526
      jm.evers
      Participant
      Up
      0
      Down
      ::

      The « trick » is to force the Mathml into a table cell apart from the input field and NOT to put mathml+input in the same cell (…)
      The same is true for other XML includes (like SVG…) in (X)HTML

    • #1530
      jm.evers
      Participant
      Up
      0
      Down
      ::

      So it is dependant on the browser, the system or the version. Not on the way to use the table (as css or normally). It is exactly what I wanted to emphasize !

      Absolutely not !!!
      Using the MathML + input field » together in

      • one table-cell
      • one paragraph
      • one div

      is your problem.
      (assuming you don’t want to work with ‘absolute width/height’)
      The only sensible way to force « Mathml + inputfield » in an (optical) horizontal alignment is to use two table-cells in a single row.
      <tr><td>MATHML</td><td>INPUTFIELD</td></tr>
      Just try it
      kind regards,
      J.M. Evers
      about css ,inputfields and tables

Vous lisez 11 fils de discussion
  • Vous devez être connecté pour répondre à ce sujet.