css - Setting last cell right aligned in a row -


I set my div display to table-like this way.

HTML

  & lt; Div id = "parent" & gt; & Lt; Div class = "hair" & gt; 1 & lt; / Div & gt; & Lt; Div class = "hair" & gt; 2 & lt; / Div & gt; & Lt; Div class = "hair" & gt; 3 & lt; / Div & gt; & Lt; Div class = "last hour" & gt; 4 & lt; / Div & gt; & Lt; / Div & gt;  

css

  .child {background: red; Width: 20px; Exhibit: Table-Cell; } .lastchild {background: blue; Width: 20px; Exhibit: Table-Cell; Margin-right: 0; }. Parent {width: 200px; }  

I wonder if in any way can I align the rightmost right?

Change CSS to:

  .lastchild {background: blue; Width: 20px; Exhibit: Table-Cell; Margin-right: 0; float right; } .child {background: none repeat scroll 0 0 red; Exhibit: Table-Cell; Swim left; Width: 20px; }  

Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -