Title: Inline style for PHP code from a Pluggin
Last modified: August 20, 2016

---

# Inline style for PHP code from a Pluggin

 *  [alemist](https://wordpress.org/support/users/alemist/)
 * (@alemist)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/inline-style-for-php-code-from-a-pluggin/)
 * Hello!
 * Please, I need help styling a
    tag inside a PHP code. (I am new to PHP, I do 
   not write PHP code). I tried writing the styling inside the tag, but it didn’t
   work. This is the code:
 *     ```
       <form name="post" action="<?php echo get_permalink(); ?>" method="post" id="post" style="text-align: left;">
   
       <ol>
       <?php
       for ($i = 0; $i < $num_questions; $i++) {
           echo "<p><li>" . wqp_escape_string($question[$i]) . "</li>\n";
           $order_answers = array_keys($answer[$i]);
           shuffle($order_answers);
           while (!is_null($j = array_pop($order_answers))) {
               echo "    <input type=\"radio\" name=\"answer[{$i}]\" id=\"answer-{$i}-{$j}\" value=\"{$j}\" /> <label for=\"answer-{$i}-{$j}\">" . wqp_escape_string($answer[$i][$j]) . "</label><br />\n";
           }
           echo "</p>\n";
       }
       ?>
       </ol>
   
       <p class="submit">
       <input type="submit" name="submit" style="font-weight: bold;" value="Enviar respuestas" />
       </p>
   
       <input type="hidden" name="quiz_id" id="quiz_id" value="<?php echo wqp_safe_value($quiz_id); ?>" />
   
       </form>
       ```
   
 * _
    [Sorry, your list tags totally messed up the parser here – some was deleted]

Viewing 6 replies - 1 through 6 (of 6 total)

 *  [WPyogi](https://wordpress.org/support/users/wpyogi/)
 * (@wpyogi)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/inline-style-for-php-code-from-a-pluggin/#post-3488911)
 * Why are you trying to use inline styles? Use the tags, ids or classes to use 
   external CSS. What is the **rendered** HTML code and what are you trying to do
   to it?
 * Please carefully use the code buttons when posting code here, or better yet, 
   use a [pastebin.](http://codex.wordpress.org/Forum_Welcome#Posting_Code)
 *  Thread Starter [alemist](https://wordpress.org/support/users/alemist/)
 * (@alemist)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/inline-style-for-php-code-from-a-pluggin/#post-3489022)
 * Hi WPyogi!
    Thank you very much for answering!
 * I am trying to style the `<li>` tag whithin the line:
 * `echo "<p><li>" . wqp_escape_string($question[$i]) . "</li>\n";`
 * from the code above.
 * I want to use this style: `style="font-weight: bold;"`
 * I can use external classes or ids but I don’t know how to insert them withih 
   the `<li>` tag in the code. (I tried with an inline style using `style="font-
   weight: bold;"` and it didn’t work).
 * I am rendering this HTML line:
    `<li>¿Con cuál frase te identificas más?</li>`
 * Just in case, I pasted in pastedbin the complete HTML generated.
    This is the
   link: [http://pastebin.com/pnUdsJsP](http://pastebin.com/pnUdsJsP)
 * How could I do the rendering??
 * Thank you very much for your help in advance.
 *  Thread Starter [alemist](https://wordpress.org/support/users/alemist/)
 * (@alemist)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/inline-style-for-php-code-from-a-pluggin/#post-3489023)
 * I am using the Code bottom for code lines, but it seems it didn´t work.
    Please,
   let me know if you can see the message properly. I will paste it again if that
   is the case.
 *  [WPyogi](https://wordpress.org/support/users/wpyogi/)
 * (@wpyogi)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/inline-style-for-php-code-from-a-pluggin/#post-3489059)
 * Try adding a class to the form tag or the `<ol>` tag – then you can use that 
   in your external CSS.
 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/inline-style-for-php-code-from-a-pluggin/#post-3489060)
 * general, when using quotation marks in your code, make sure to either use single
   quotes and double quotes in the correct places, or escape the quotes;
 * example – escaped quotes:
 * `echo "<p><li style=\"font-weight: bold;\">" . wqp_escape_string($question[$i])."
   </li>\n";`
 * example – different quotes, i.e. single quotes for the strings, double quotes
   for the style:
 * `echo '<p><li style="font-weight: bold;">' . wqp_escape_string($question[$i]).'
   </li>'."\n";`
 * or possibly, double quotes for the strings, single quotes for the style:
 * `echo "<p><li style='font-weight: bold;'>" . wqp_escape_string($question[$i])."
   </li>\n";`
 *  Thread Starter [alemist](https://wordpress.org/support/users/alemist/)
 * (@alemist)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/inline-style-for-php-code-from-a-pluggin/#post-3489061)
 * Thank you WPyogi and Alchymyth.
 * I just found the ID for that area and applied the style in the external CSS.
 *     ```
       #post-852 li{
       	font-weight: bold;
       }
       ```
   
 * And it worked.
    But I don’t know if this post ID is permanent.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Inline style for PHP code from a Pluggin’ is closed to new replies.

## Tags

 * [inline style](https://wordpress.org/support/topic-tag/inline-style/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 6 replies
 * 3 participants
 * Last reply from: [alemist](https://wordpress.org/support/users/alemist/)
 * Last activity: [13 years, 3 months ago](https://wordpress.org/support/topic/inline-style-for-php-code-from-a-pluggin/#post-3489061)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
