user4774710
user4774710

Reputation:

How to style the value of a placeholder like if I want to give a margin at left of that value, what to write in css?

<html>
<body>
    <div class="user_name floatleft fix">
        <input placeholder="User name" type="text"/>
    </div>
</body>
</html>

I want to give some margin at left of "User name" in input. Please help.

Upvotes: 0

Views: 2468

Answers (1)

dowomenfart
dowomenfart

Reputation: 2803

Give padding to the input Demo

input{
    padding-left: 5px;
}

If you want to be more specific and not effect all inputs in your HTML. You can do this:

.user_name > input {
    padding-left: 5px;
}

Upvotes: 2

Related Questions