button goes full screen width

A

Andrew Poulos

There's this HTML

<input id="print" type="submit" value="" onclick="printPage();">

and this javascript

if (document.getElementById("print")) {
var prn = document.getElementById("print");
prn.value = str.printbutton;
prn.style.position = "absolute";
prn.style.right = "24px";
prn.style.bottom = "24px";
prn.style.cursor = "pointer";
}

str.printbutton is a string that the user sets earlier.

On IE 7 the button stretches across the entire page, except for 24
pixels on the right hand side. If a width is set then the button honours
it but as I can't know the button label the user will set beforehand I
can't set a width.

Is there a way to get the button to be only as wide as it needs to be
and no more?

Andrew Poulos
 
T

Thomas 'PointedEars' Lahn

Andrew said:
On IE 7 the button stretches across the entire page, except for 24
pixels on the right hand side. If a width is set then the button honours
it but as I can't know the button label the user will set beforehand I
can't set a width.

Is there a way to get the button to be only as wide as it needs to be
and no more?

Probably yes. You are looking for
comp.infosystems.www.authoring.misc.stylesheets.


PointedEars
 
T

Thomas 'PointedEars' Lahn

Andrew said:
Thanks. I hope they don't push me back here.

You need to ask a smart question, i.e. don't bother them with your scripts.
They are irrelevant to your problem.


PointedEars
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,813
Messages
2,569,696
Members
45,482
Latest member
AshleighMo

Latest Threads

Top