Solved

Standardizing button widths in "pure" HTML

Posted on 2000-04-12
10
160 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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
 
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Button on Table, name table1 not working 4 34
..ignore the Question 1 21
disable open new tab with right mouse click in <a> tag 3 19
CSS for Popup in ASP.NET 4 19
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

726 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