Jump to content

How to make tiny 12px by 12px square buttons?


benphp

Recommended Posts

I can make the buttons the right size, but I can't get the plus (+) and minus (-) text to pop into the middle:

 

<html>
<head>
<style type="text/css">
	.SmallButton {
		padding:0px;
		height:12px;
		width:12px;
		font-size:9px;
	} 
    </style>
</head>
<body>
<input type="submit" name="btnWrite" value="+" class="SmallButton">
</body>
</html>

 

 

Try it like this.  You should always make sure you have a document type defined because it will affect the rendering of css, etc...

 

<!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" xml:lang="ru">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />

<style>
.SmallButton {
padding:0px;

width:14px;
height:14px;
}

	.SmallButton span {
	font-size:9px;
line-height:10px;
position:relative;
top:-2px;
left:-3px;
}
</style>
</head>
<body>
<button type="submit" name="btnWrite" value="+" class="SmallButton">
<span>+</span>

</button>
</body>
</html>

 

Ahh I see what you are saying.

 

I just tried it out - you're right, the line-height doesn't affect anything with submit buttons. I don't really have a solution for you on this one mate. Sorry. Post back here if you figure something out - I'm curious about it.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.