-2

I have some elements on the html page.

All elements do not start vertically with same relative pixel(say all start from vertically centre line of the window..).

how do i set all these element start vertically with the same relative pixel??

i am trying with 'left' css property. but it doesn't work.

left: 50%!important;

In short with this http://jsfiddle.net/EPREq/ i want both the 'Koka' word should start from the same vertical line. Please don't use HTML table to do this. Using table in my page will have many problems.

codeofnode
  • 18,169
  • 29
  • 85
  • 142
  • 2
    Can you post your code? It would make helping you easier. – Paweł Duda Nov 29 '13 at 15:36
  • 1
    It isn't totally clear what it is you're asking at this point. Take a couple of minutes to put together an example [JSFiddle](http://jsfiddle.net/) which demonstrates what you're describing and I'm sure someone will be able to help! – johnkavanagh Nov 29 '13 at 15:42
  • Here is the jsfiddle http://jsfiddle.net/EPREq/ and please go through the edit – codeofnode Nov 29 '13 at 15:56
  • updated : http://jsfiddle.net/EPREq/1/ – codeofnode Nov 29 '13 at 15:58
  • `left` requires you to set a `position` property...It won't do anything on it's own. `position:absolute; top:0; left:0`. http://stackoverflow.com/questions/14171855/css-left-not-working – Nick R Nov 29 '13 at 16:02

2 Answers2

0

you can try

margin-left:50% !important;
Aditzu
  • 696
  • 1
  • 14
  • 25
0

The following worked for me :

http://jsfiddle.net/EPREq/6/

<div>
    <span class="a" > Hi </span>
    <span class="b">Koka</span> 
 </div>

<div>
    <span class= "a"> Hiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii </span>
    <span class= "b">Koka</span> 
 </div>


.a {
   width : 300px; 
    display: inline-block;
}

.b {

}
codeofnode
  • 18,169
  • 29
  • 85
  • 142