Solved

Standardizing button widths in "pure" HTML

Posted on 2000-04-12
10
156 Views
Last Modified: 2010-04-09
I know this falls outside what HTML "should" be doing, but is there any way in MS-IE to get standard widths for INPUT SUBMITs? In Netscape I'd have two options: use a WIDTH parameter, or set the font to a fixed width font and pad the VALUE with spaces.  Neither of these techniques seem to work in IE.  Is there at tiny smatterign of CSS I could use, or some little trick?
0
Comment
Question by:kisrael
  • 4
  • 3
  • 2
  • +1
10 Comments
 
LVL 1

Expert Comment

by:ManoloMA
ID: 2708278
You can create a style

<STYLE>
..button{
  WIDTH: 80px;
  FONT-FAMILY: Arial;
  FONT-SIZE: 8pt
}
..text{
  WIDTH: 80px;
  FONT-FAMILY: Courier New;
  FONT-SIZE: 8pt;
}
</STYLE>

<BODY>

<INPUT type="text" class="text">
<INPUT type="submit" class="button">
0
 

Author Comment

by:kisrael
ID: 2708388
Cool, this may be just what I'm looking for.
It seems like Netscape ignores it, is that correct?

Also, what does the .. before the class names?
0
 

Author Comment

by:kisrael
ID: 2708431
And should the STYLE tags be in the HEAD tags of the page? or just before the BODY?
0
 
LVL 3

Accepted Solution

by:
davlun20080 earned 100 total points
ID: 2709125
You can actually specify the style="width: 200px" within the <input> tag, right next to the size = "" command.  If there is a style attribute in the input tag, IE will ignore the size="" and NS will ignore the style portion.  For font class attributes, you can wrap the input tag in a span with a class statement for NS and place that same class in the input tag as well for IE.

davlun
0
 

Author Comment

by:kisrael
ID: 2709142
Thanks, that's a cleaner version of the above.

ANd now the $24.00 question: is there a version that also work with 4.7 Netscape for the Mac?
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 3

Expert Comment

by:davlun20080
ID: 2709191
Not sure on the mac end of things... Have you tried it and it doesn't work?
0
 

Author Comment

by:kisrael
ID: 2709287
Someone on my team at work did, yeah-
it seems that it doesn't repect the WIDTH parameter.
0
 
LVL 3

Expert Comment

by:davlun20080
ID: 2709451
NS should be picking up the size="" attribute and not the width statement.  It may be possible that the mac version is displaying differently as an extension of the way mac displays fonts, about 4 pt sizes smaller than IE.

Just as a test try increasing your font-size for the mac only, then see if they are nearly the same size.

davlun
0
 
LVL 1

Expert Comment

by:ManoloMA
ID: 2709568
About your cuestion:

- Also, what does the .. before the class names?


It's a bug of this WEB.

I put one point here:
..

appears two points when the comment is submited.


About the class (I don't know if it works with NS), you can create one to all the INPUTS tags in the page, an put a class to the inputs you want to change:

<STYLE>
..button{ //There is only one '.'
  WIDTH: 80px;
  FONT-FAMILY: Arial;
  FONT-SIZE: 8pt
}
INPUT{
  WIDTH: 80px;
  FONT-FAMILY: Courier New;
  FONT-SIZE: 8pt;
}
</STYLE>

<BODY>

<INPUT type="text">
<INPUT type="submit" class="button">

0
 
LVL 2

Expert Comment

by:burntout
ID: 2711282
Well This will work for sure, I don't know if you want to do it but you can use an image submit button, just draw a button in paintshop or do a screen capture of a real button and use it.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Showing your events from Google Calendar in Google Maps Why? I travel all week and I thought it would be ideal if staff in office knew where I was based on my calendar. (OK real reason: my son wanted to see where I would be working, and I thoug…
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now