Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to align specific element to the right using :last-child pseudo
    primarykey
    data
    text
    <p>At this fiddle...</p> <p><a href="http://jsfiddle.net/jeljeljel/sARz2/" rel="nofollow">http://jsfiddle.net/jeljeljel/sARz2/</a></p> <p>I need to align the bolded date values to the right of the parent container. Using a :last-child pseudo element how would I adjust the css to make this happen? I have an attempt at this in the css below.</p> <p><strong>HTML</strong></p> <pre><code>&lt;div class="editIssueForm"&gt; &lt;div class="commentContainer"&gt; &lt;div&gt; &lt;div class="comment"&gt; &lt;div&gt; &lt;span&gt;Entered by: Paul Reid&lt;/span&gt; &lt;span&gt;4/3/2013 3:45 PM CST&lt;/span&gt; &lt;/div&gt; &lt;div&gt;ipsum dolor sit amet, consectetur adipiscing elit. Praesent pulvinar, lectus vitae rutrum accumsan, ligula mauris bibendum magna, vel vestibulum erat ante vel metus. Integer blandit, libero eu dignissim pellentesque, massa lectus placerat mi, eu adipiscing neque velit vitae turpis. Maecenas iaculis dui in urna iaculis mattis. Suspendisse ut erat turpis. Nullam pulvinar fringilla semper. Nulla facilisi. Nunc eu tortor eu ipsum adipiscing facilisis. Proin lacinia quam non nulla fermentum a cursus nunc consequat. Suspendisse id diam orci, sed pretium nibh. Sed eros tortor&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p><strong>CSS</strong></p> <pre><code>.editIssueForm { border: 1px solid lightblue; width: 300; } .editIssueForm .commentContainer { width: 300; height: 200; overflow-y: scroll; } .editIssueForm .commentContainer .comment { padding-left: 5px; } .editIssueForm .commentContainer .comment div:first-child { font-weight: bold; display: inline-block; } </code></pre> <p><strong>these pseudo selectors don't work. how can the css be adjusted to make them work?</strong></p> <pre><code>.editIssueForm .commentContainer .comment div:first-child span:first-child { float: left; padding-left: -5px; } .editIssueForm .commentContainer .comment div:first-child span:last-child { float: right; } </code></pre> <p><strong>end</strong></p> <pre><code>.editIssueForm .commentContainer .comment div:first-child:after { content: "."; display: block; clear: both; visibility: hidden; line-height: 0; height: 0; } .editIssueForm .commentContainer .comment:nth-child(n+2) { border-top: 1px solid #ddd; padding-top: 5px; margin-top: 5px; } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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