Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The thing to remember is that an <code>inline style</code> will apply to the element in which tag it is defined. To affect the inputs you'd need to target them directly (demo: 1) by either adding a <code>class</code> to them, target all inputs (demo: 2) or, as jthompson suggests, target those inputs that are descendants of the particular div (see jthompsons' answer).</p> <ol> <li><ol><li>`input {padding-right: 15px; }`, or</li> <li>`input[type="radio"] {padding-right: 15px; }` // this is CSS3 only, I think.</li></ol> <li>add `class="q1-radio-inputs"` and use the CSS `.q1-radio-inputs {padding-right: 15px; }`</li> </ol> <p>It's also worth noting that using inline styles doesn't make much sense, except where it needs to override a particular style one time only, it's always (so far as I can tell) wiser to use an external sheet, in order for caching (if nothing else) and for making it slightly easier to affect all styles when redesigning/reworking the site.</p> <p>And, as an addenda, styles are applied in the following order: inline-stlyes override styles defined in the header, which in turn override external stylesheets. Unless a style is defined with the <code>!important</code> marker, in which case it is not overridden (all being well).</p> <p>The following (sort of) helps: <a href="http://www.w3.org/TR/CSS2/cascade.html" rel="nofollow noreferrer" title="Link to the W3's website 'Assigning property values, Cascading, and Inheritance.'"><a href="http://www.w3.org/TR/CSS2/cascade.html" rel="nofollow noreferrer">http://www.w3.org/TR/CSS2/cascade.html</a></a></p> <hr /> <h2>Edited in response to comments:</h2> <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"&gt; &lt;head&gt; &lt;style type="text/css" media="screen"&gt; .div#options input { padding-right: 15px } &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="question" style="padding-bottom: 15px"&gt; What day is it today? &lt;div id="options"&gt; &lt;input type="radio" name="question1" /&gt;Sunday &lt;input type="radio" name="question1" /&gt;Monday &lt;input type="radio" name="question1" /&gt;Saturday &lt;input type="radio" name="question1" /&gt;Tuesday &lt;/div&gt; &lt;/div&gt; &lt;div id="question" &gt; What month is it? &lt;div id="options"&gt; &lt;input type="radio" name="question1" /&gt;Jan &lt;input type="radio" name="question1" /&gt;Feb &lt;input type="radio" name="question1" /&gt;May &lt;input type="radio" name="question1" /&gt;Dec &lt;/div&gt; &lt;/div&gt; &lt;/html&gt; </code></pre> <p>If the html, above, remains representative of your site (as linked in the comments to this answer), the problem may well be:</p> <p><code>.div#options</code></p> <p>the period is used to indicate a <code>class</code> name, the pound '#' is used to indicate a <code>div</code> name, and only one or the other can be used at one time:</p> <pre><code>div.options /* is fine, indicating a 'div' of class-name 'options' */ div#options /* is also fine (and both within the same document is, also, fine) indicating a div of id-name 'options' - an id is unique, and can be used only *once* per document */ .div#options /* could be fine, but appears to be targeting an element of id-name 'options' within an element of class-name 'div,' which is not found within your document. */ </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload