Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

text field & title + image

Status
Not open for further replies.

vlitim

Programmer
Sep 2, 2000
393
GB
couple of questions:

1. how do you assign a title via a stylesheet as the below doesn't work:

<input type=text class=showHelp>

.showHelp{
title: "hello there"
}

2. I want a background-image to take up the last 3px of a text field (which I can do) but I don't want the users input to go over it.

bit stuck

Cheers

Tim
 
1) Don't think you can do that with CSS - might be wrong tho

2) You could limit the number of character they can enter
Code:
<input type="text" maxlength="10" />

Tony
[red]_________________________________________________________________[/red]
Webmaster -
 
1. You can't. Stylesheets are for controling the visual aspect not the content one. You will need to put your title attributes inside each html tag.

2.
Code:
input {
  background: url(myImage.gif) top right no-repeat;
  padding-right: 3px;
}
This should work eventhough sometimes padding is completely ignored in browsers when content starts overflowing. Also, I don't think all browsers support background images in input fields (namely Safari for Mac), so make sure this is just for aesthetic purposes and not really a necessity on the site.
 

1. You can't. You will have to use JavaScript or set it on the element in the HTML.

2. You can't stop text from being displayed at a certain point in an input field.

Hope this helps,
Dan


[tt]D'ya think I got where I am today because I dress like Peter Pan here?[/tt]
[banghead]

 
Well I thought as much but somtimes its worth asking the experts!

Cheers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top