Is there a way to align the text within a text input (not textarea). I want to display the numbers as right aligned and some values as center aligned, but something like <INPUT TYPE="text" align="center"> doesn't work

Recommended Answers

All 3 Replies

Member Avatar

use styles

<INPUT TYPE="text" style="text-align: center;">

And for Global change you can use this

<style type="text/css">
<!--
input
	{
		text-align:center;
		font-family:Verdana, Arial, Helvetica, sans-serif;
		color:#666666;
	}
-->
</style>

Thanks Visesh and Katarey

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.