Solved

Standardizing button widths in "pure" HTML

Posted on 2000-04-12
10
161 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: 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!

Question has a verified solution.

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

Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…

636 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