473,325 Members | 2,712 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,325 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 10416
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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.