[[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
Next revisionBoth sides next revision
en:create:functions:html [24.12.2014 18:18] – [Tips] alexander.ritteren:create:functions:html [09.03.2022 11:13] – [Example] ruth.noppeney
Line 14: Line 14:
 html('<h1>Welcome!</h1>'); html('<h1>Welcome!</h1>');
 html(' html('
-  <p>Line breaks are +  <p>Line breaks will be ignored.</p>
-  not a problem here.</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 =====
Line 59: Line 73:
 text('cartext'); text('cartext');
  
-// And this roundabout way works+// And this workaround also works
 html('<p>This is a ne'.'w car</p>'); html('<p>This is a ne'.'w car</p>');
 </code> </code>
en/create/functions/html.txt · Last modified: 09.03.2022 15:48 by admin
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
Driven by DokuWiki