473,224 Members | 1,509 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,224 software developers and data experts.

Text align of <input type="submit"> and Mozilla 1.4?

See example at <URL:http://www.cc.jyu.fi/~mira/moz/formtest.php>.

The problem is that the label of submit button is always centered on the
button regardsless of 'text-align' property in CSS. Considering that I
can style everything else, this must be a bug, right?

Any suggestions how to fix the issue with Mozilla 1.4? How about other
versions of Mozilla? How about other browsers?

(I'm aware that some people think that one should never modify rendering
of any form element. No need to tell me that.)

--
Mikko

Jul 20 '05 #1
5 10405
Mikko Rantalainen <mi**@st.jyu.fi> writes:
See example at <URL:http://www.cc.jyu.fi/~mira/moz/formtest.php>.

The problem is that the label of submit button is always centered on
the button regardsless of 'text-align' property in CSS. Considering
that I can style everything else, this must be a bug, right?
Hmm. The <input> is a replaced inline element, which is presumably
aligned _as an element_ according to the spec. The label on the
<input> is a part of the display of the element - IMO it makes as much
sense for text-align to apply to this as it would to text in an
embedded SVG image, or similar.
Any suggestions how to fix the issue with Mozilla 1.4? How about other
versions of Mozilla? How about other browsers?


Graphical submit button? Though they have their own raft of problems,
of course.

--
Chris
Jul 20 '05 #2
Chris Morris wrote:
Mikko Rantalainen <mi**@st.jyu.fi> writes:
See example at <URL:http://www.cc.jyu.fi/~mira/moz/formtest.php>.

The problem is that the label of submit button is always centered on
the button regardsless of 'text-align' property in CSS. Considering
that I can style everything else, this must be a bug, right?


Hmm. The <input> is a replaced inline element, which is presumably
aligned _as an element_ according to the spec. The label on the
<input> is a part of the display of the element - IMO it makes as much
sense for text-align to apply to this as it would to text in an
embedded SVG image, or similar.


May I ask why do you think that input is a replaced inline element? It
might be that Mozilla treats input like one, but I think there's nothing
in the spec suggesting that <input> element should be a replaced
element. Considering that <input type="text"> can be styled to the
bottom of my hearth, I consider it a bug (requiring a workaround) not to
be able to align text of submit button as I like - it would make more
sense to have all form elements as replaced or all elements as styleable.

Any suggestions how to fix the issue with Mozilla 1.4? How about other
versions of Mozilla? How about other browsers?


Graphical submit button? Though they have their own raft of problems,
of course.


I'd rather take an unstyled submit button than a graphic. I'd end up
with all the localization issues in the future plus graphic doesn't
scale when the user is unhappy with the default font size. If I ever
want to change the text, I have to fix both the graphic and the alt
text. Not that much fun...

--
Mikko

Jul 20 '05 #3
Mikko Rantalainen wrote:
Chris Morris wrote:
Mikko Rantalainen <mi**@st.jyu.fi> writes:
See example at <URL:http://www.cc.jyu.fi/~mira/moz/formtest.php>.

The problem is that the label of submit button is always centered on
the button regardsless of 'text-align' property in CSS. Considering
that I can style everything else, this must be a bug, right?

Hmm. The <input> is a replaced inline element, which is presumably
aligned _as an element_ according to the spec. The label on the
<input> is a part of the display of the element - IMO it makes as much
sense for text-align to apply to this as it would to text in an
embedded SVG image, or similar.

May I ask why do you think that input is a replaced inline element? It
might be that Mozilla treats input like one, but I think there's nothing
in the spec suggesting that <input> element should be a replaced
element.


Here it is:

<http://www.w3.org/TR/CSS2/conform.html#replaced-element>
Replaced element
An element for which the CSS formatter knows only the intrinsic
dimensions. In HTML, IMG, INPUT, TEXTAREA, SELECT, and OBJECT elements
can be examples of replaced elements. For example, the content of the
IMG element is often replaced by the image that the "src" attribute
designates. CSS does not define how the intrinsic dimensions are found.

Matthias

Jul 20 '05 #4
Mikko Rantalainen <mi**@st.jyu.fi> writes:
Chris Morris wrote:
Mikko Rantalainen <mi**@st.jyu.fi> writes:
The problem is that the label of submit button is always centered on
the button regardsless of 'text-align' property in CSS. Considering
that I can style everything else, this must be a bug, right?
Hmm. The <input> is a replaced inline element, which is presumably


May I ask why do you think that input is a replaced inline element? It


http://www.w3.org/TR/CSS2/conform.html#replaced-element is suggestive.
Though not binding, as far as I can tell.

Actually, replaced or non-replaced it doesn't matter, since text-align
is only supposed to apply to block level elements anyway, applying it
to the _contents_ of any inline element seems unusual.
it would make more sense to have all form elements as replaced or all
elements as styleable.


Perhaps there is an inconsistency in Mozilla, if so I think the most
consistent with the spec is to not allow text-align to affect anything
_inside_ any form control.

--
Chris
Jul 20 '05 #5
Chris Morris / 2003-09-24 14:19:
Mikko Rantalainen <mi**@st.jyu.fi> writes:
Chris Morris wrote:

Hmm. The <input> is a replaced inline element, which is presumably
May I ask why do you think that input is a replaced inline element? It


http://www.w3.org/TR/CSS2/conform.html#replaced-element is suggestive.
Though not binding, as far as I can tell.


Yes, the wording is suggestive even though the section is supposed
to be formal.
Actually, replaced or non-replaced it doesn't matter, since text-align
is only supposed to apply to block level elements anyway, applying it
to the _contents_ of any inline element seems unusual.


If you check the example I gave, you'll notice that I've "display:
block" which makes it [replaced?] block level element. The display
property has the effect I expect from any non-replaced element so I
guess it's working. Also, one can successfully apply pretty much all
CSS properties to <input type="text"> and <textarea> elements so I
guess those aren't replaced elements.
it would make more sense to have all form elements as replaced or all
elements as styleable.


Perhaps there is an inconsistency in Mozilla, if so I think the most
consistent with the spec is to not allow text-align to affect anything
_inside_ any form control.


Yes, that's definately an inconsistency in Mozilla but I'm still
wondering if there's some hack I can use? My point is that Mozilla
applies 'text-align' property to <input type="text"> and <textarea>
(the content of those) so *it can style form elements*. I guess the
rendering engine can align the button label as required if I can
poke it with suitable CSS declarations. Probably some property
starting with "-moz-". MSIE "correctly" styles input buttons without
any problems.

--
Mikko

Jul 20 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: Dan R Brown | last post by:
I have a large form that is generated dynamically in a jsp using xml / xslt. So, to break up this form into several "tabbed" sections, I break up the form using <div> tags. Each <div...
3
by: Pete Wilson | last post by:
How can I highlight the <input type="submit"> object that I want to highlight? 1. In my form, the user enters his ID. He sees two submit "buttons," left labeled Cancel, the right labeled Signup....
2
by: Laermans_k | last post by:
Hi, Does anyone have a solution to use the <input type="file" id="filechooser"> and the <input type="submit" id="submitbutton"> in 1 button click? I've already tried to create a javascript...
2
by: Tarkeshwar | last post by:
Hi All, I want to restrict the user from being entering the value in <input type="file">. It works fine in IE but not in Mozilla. I am sending my code also which works in IE and not in Mozilla.Can...
1
by: mark4asp | last post by:
<form runat="server"automatically adds <divtag to code contained within. Is there a way to stop that? Mixing block-level elements with inline-level elements messes up the HTML becasuse that is...
18
by: zoilus | last post by:
Can not determine how "<?=PHP_SELF?>" is supposed to work. The below is the line of code. <!-- <form name="search" method="post" action="<?=$PHP_SELF?>"--> When the above statement is run the...
1
by: mark | last post by:
Forgive me if this seems like a stupid question but I need help... I'm trying to do a simple online form that emails me the results from a few fields. Here is the code: <form...
1
by: ChollaPete | last post by:
This code: <form action="processScan.php" method="get"> <p> <?php print "Scan name: <input type=\"file\" name=\"tScanFileName\" value= \"{$scanFileName}\"><br>"; addHiddenCarryons(); ?>...
14
by: white lightning | last post by:
How to have <select onchange="this.form.submit()"and also a Submit button on one form? I have something like this: <form action="<?php $_SERVER; ?>" method="post"...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.