[[html()]]
 

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
en:create:functions:html [24.12.2014 18:26] – [Tips] alexander.ritteren:create:functions:html [09.03.2022 15:48] (current) – [Example] admin
Line 10: Line 10:
  
 ===== Example ===== ===== Example =====
 +
 +**Note:** It is usually better to create a //Text// in the **List of Questions** to store any longer HTML code. This text is than dragged into the questionnaire page like a question ([[:en:create:texts]]).
  
 <code php> <code php>
 html('<h1>Welcome!</h1>'); html('<h1>Welcome!</h1>');
 html(' html('
-  <p>Line breaks are +  <p>Line breaks 
-  not a problem here.</p>+  will be ignored.</p>
 '); ');
 </code> </code>
 +
 +===== HTML-Code and other elements =====
 +
 +Other elements -- especially questions and text elements -- also generate HTML code. You can use ''html()'' to add more HTML code before and after these elements. This allows you, for example, to embed a question in another HTML element in order to change the width.
 +
 +The following PHP code displays the question AB01 centered in a block with a maximum width of 600 pixels. 
 +
 +<code php>
 + html('<div style="max-width: 600px; margin: 0 auto;">');
 + question('AB01');
 + html('</div>');
 + </code>
 +
 +You can find an application within the instructions for [[:en:create:table-layout]].
 +
  
 ===== Tips ===== ===== Tips =====
en/create/functions/html.1419442007.txt.gz · Last modified: by alexander.ritter
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
Driven by DokuWiki