Sriram
Sriram

Reputation: 21

how to access this class in css

<form name="fc">
         <div class="input-text">
         <input type="text" id="postquestion" name="postquestion" style="font-size:12px;"class="ps" value="" placeholder="What's Your Question..?" data-mini="true" />
         <a href="#dialog" class="dig" value="" data-role="button" data-icon="plus" data-inline="true" data-rel="dialog" data-iconpos="notext"></a>
         <input type="submit" value="Ask" class="ask" data-inline="true" data-mini="true"data-theme="b"/>
      </div>
</form>

this code is not working

.ask
{
margin-top:-10px;
}

i'm newbie to css , please help me. http://jsfiddle.net/shreeramns/4dRuP/

Upvotes: 0

Views: 72

Answers (2)

madhushankarox
madhushankarox

Reputation: 1477

you may have to use float:left for both of the button and textbox

   .ask{
        margin-top:-10px;
        display:inline;
        position:relative;
        float:left;
    }
    .ps{
        float:left;
        display:inline;
    }

Preview >> http://jsfiddle.net/vmyc8/

Upvotes: 0

Zeta
Zeta

Reputation: 105955

input is an inline-element, thus it cannot have any margin applied. You need to make it a block-level element:

.ask
{
    display: inline-block;
    margin-top:-10px;
}

Furthermore, you shouldn't use negative margins if possible, use positioning instead.

Upvotes: 3

Related Questions