By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,856 Members | 1,845 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,856 IT Pros & Developers. It's quick & easy.

text-indent

P: n/a
Hi,

I have a submit-element with a background-image of 16x16 px and the
following style:

background-image: url("ok.gif");
background-repeat: no-repeat;
text-indent: 20 px;

The problem is, that text-indent is ignored. When I supply the style to a
span, everything is fine.

Is text-indent not supported for buttons/submits? If not, how can I achieve
this indent for a button?

Thank you.
Jun 21 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Scripsit Chris Seidel:
I have a submit-element with a background-image of 16x16 px and the
following style:

background-image: url("ok.gif");
background-repeat: no-repeat;
text-indent: 20 px;
Why? It sounds like you have no text in the button, just an image with text
"OK" in the background. Of course, you could and should have posted the URL
for clarification.

If that's the case, then you have done extra work to create a serious
accessibility problem. What happens when image display is disabled, or the
page is accessed using a screen reader or a Braille device?
The problem is, that text-indent is ignored.
That's correct by the specifications. Check the "Applies to" part.
When I supply the style
to a span, everything is fine.
Huh? No URL here either.
Is text-indent not supported for buttons/submits?
If you set display: block, then text-indent applies in principle. But what
is the textual contents that could have its first line indented? The input
element is empty by definition.

Do you wish to indent the text inside the button, or the button itself?
If not, how can I
achieve this indent for a button?
You're not telling what you want to indent and why you would do it that way
rather than margin or padding.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

Jun 21 '07 #2

P: n/a
Jukka K. Korpela wrote:
You're not telling what you want to indent and why you would do it
that way rather than margin or padding.
Thanks alot. padding-left did the job :)
Jun 22 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.