How to give an input field of type text a few spaces before Text starts

Hallo,

I am wondering how does one give a form type of text a few spaces before the text in that field starts?

Thanks.

Is this what you mean? http://www.visibilityinherit.com/code/clear-input-value.php

Hi,

No. I mean what is the code to have the start of the Text inside a from Input field to be X pixels from the start of the Input field left side.
For example look here:

What I want is to have:
“I am looking for”
to start a few pixels from where it is now.

ThanX

Give the input padding-left:10px

I did.
That does not work. It does nothing.

Just tested yes it does.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>untitled</title>
<style>input{padding-left:20px}</style>
</head>
<input type="text" name="" value="">
<body>
</body>
</html>

As Eric said it will work if you target the element correctly.


.search_box{padding-left:10px}

Hi,

That Works.
FYI, I wanted to do it this way:

<input type=“text” name=“find” maxlength=“40” class=“search_box” style=“width: 400px; padding-left: 10px;” value=“<?php echo $_SESSION[‘find’]; ?>”>

but it was not working that way!
But it works Ok as you noted when the padding info is entered into the .css file

ThanX