PDA

View Full Version : Resolved Visual problem with text in buttons



yeri
Apr 14th, 2009, 05:40 PM
Hello,

I try to right or left align a text in a button, but Firefox doesn't position it totally left or right, it leaves a border. It's OK in IE.

Anybody got an idea to delete this space? :(

You can see an example here: (Open it in FF and IE)
http://www.keroops.com/buttontest.html

Thank you!

EDIT: thanks to "abduraooft". Solution is to add "margin:0; padding:0;" to the button

nick1988
Apr 14th, 2009, 05:53 PM
Heya,

Don't have two different browsers at work, but I am pretty sure what the problem is.

Try:


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta content="text/html; charset=windows-1252" http-equiv="Content-Type" />
<title>Sin título 1</title>

<style type="text/css">
input {
text-align: right;
padding: 0 5px 0 0;
margin: 0;
width: 200px;
}
</style>

</head>

<body>
<input type="button" value="test text" />
</body>

</html>

yeri
Apr 14th, 2009, 05:59 PM
Hello nick1988,
your solution is just the opposite I want: you have added space to be equal as Firefox, and I do _not_ want any space :( .

Solution of nick1988 is found here: http://www.keroops.com/buttontest2.html

abduraooft
Apr 15th, 2009, 09:40 AM
Add margin:0; padding:0; to your button.

nick1988
Apr 15th, 2009, 10:01 AM
Hello nick1988,
your solution is just the opposite I want: you have added space to be equal as Firefox, and I do _not_ want any space :( .

Solution of nick1988 is found here: http://www.keroops.com/buttontest2.html

Ahhh, my bad, sorry.

abduraooft has the solution then :-)

yeri
Apr 15th, 2009, 06:26 PM
Add margin:0; padding:0; to your button.

Thank you, that was perfect! :)