473,513 Members | 2,658 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

button element with image in it

Can the

<button><img></button>

mutated via CSS so, that the inner image of <BUTTON>
would entirely visually become the button itsself - I mean without the
outer elements borders and so...

I tried removing paddings and borders and margins but this wouldnt seem
to help. in MSIE, Mozilla and Opera - there still some pieces of the
button are left to be seen and te inner image wouldnt cover the whole
area. Using the <img> as an background image for buttons isnt an option
because it would crate a CSS bloat declarations.
Jul 20 '05 #1
6 6876
Marek Mänd wrote:
I tried removing paddings and borders and margins but this wouldnt seem
to help. in MSIE, Mozilla and Opera - there still some pieces of the
button are left to be seen


http://www.w3.org/TR/CSS21/conform.html#conformance

| CSS2.1 does not define which properties apply to form controls [...] or
| how CSS can be used to style them. User agents may apply CSS properties
| to these elements. Authors are recommended to treat such support as
| experimental.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact

Jul 20 '05 #2
Marek Mänd <ca********@mail.ee> wrote:
Can the

<button><img></button>

[be] mutated via CSS
Absolutely maybe. But the first point to note is that the <button>
element is essentially unreliable in authoring for the WWW, due to lack
of correct support in browsers.

Use a submit button instead. Or, if you insist, an image submit button,
see http://www.cs.tut.fi/~jkorpela/forms/imagebutton.html
Test that the form works. _Then_ start considering styling.
so, that the inner image of <BUTTON>
would entirely visually become the button itsself
Then there's hardly any point in using <button>, instead of
<input type="image">.
Using the <img> as an background image for buttons isnt
an option because it would crate a CSS bloat declarations.


That statement does not quite parse. But setting a background image for a
normal submit button, <input type="submit">, is of course one possibility
in styling. It may confuse the user, since it won't really _look like_ a
submit button then, but this problem is shared by any attempt to use an
image for a button.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Jul 20 '05 #3
Jukka K. Korpela wrote:
Marek Mänd <ca********@mail.ee> wrote:
Can the
<button><img></button>
[be] mutated via CSS

Use a submit button instead. Or, if you insist, an image submit button,
see http://www.cs.tut.fi/~jkorpela/forms/imagebutton.html
Test that the form works. _Then_ start considering styling.
so, that the inner image of <BUTTON>
would entirely visually become the button itsself

Then there's hardly any point in using <button>, instead of
<input type="image">.


Well IMHO there could be some advantages:
Consider situation:
a saved pure html page without images and without stylesheets

<button type="button"><img src="unexistant"><span
style="display:none">commandbutton spare label for offsite
use</span></button>

would perform better than a <input type="image" src="unavailable">
with a tooltip. Besides tooltips everywhere in the document can be quite
frustrating. Especially amuses me all these CSS websites, that use
acronym and abbr elements quite often - one cannot even move the mouse
without annoying tooltips.... I am against flashy title tooltips, there
is a status bar for that.

Sadly <input type="image"> is by constitution about submitting form,
not as <button type="button">... Yes it can be WAd via JS, but thats
overhead.

Using hyperlinks for simulating buttons that do something on a web page
using JS - I find this approach not right because of I think of URLs as
of a way to navigate to a different page. Ofcourse when smb wants
Netscape3 compatibility then this is the way ;D
Using the <img> as an background image for buttons isnt
an option because it would crate a CSS bloat declarations.

That statement does not quite parse. But setting a background image for a
normal submit button, <input type="submit">, is of course one possibility
in styling.


Well those images for buttons would actually be different in web
application, thus for earch image a style class is too much. As icons
are much easily to be changed in serverside scripting templates than in
CSS (which just adds too much complexiti and dependancies)
Jul 20 '05 #4
Marek Mänd <ca********@mail.ee>:

a saved pure html page without images and without stylesheets

<button type="button"><img src="unexistant"><span
style="display:none">commandbutton spare label for offsite
use</span></button>

would perform better than a <input type="image" src="unavailable">
Oh please, don't act as if you had never heard of the 'alt' attribute (of
'img' and 'input' as well), nor understood it.
Sadly <input type="image"> is by constitution about submitting form,
not as <button type="button">...


I haven't checked, but hasn't 'button' to be a descendant of a 'form', too?

--
"Right way turning, Listen we are learning.
Head's full of noise, Chicken's got no choice.
Heads are rollin', Chicken blood is stolen.
The rest of the chicken wants a picke-nicken" Guano Apes - We use the Pain
Jul 20 '05 #5
Marek Mänd <ca********@mail.ee> wrote:
Then there's hardly any point in using <button>, instead of <input
type="image">.
Well IMHO there could be some advantages:


You should consider the sure disadvantages first.
Consider situation:
a saved pure html page without images and without stylesheets
Is this about authoring for the WWW, which is the topic in
comp.infosystems.www.authoring groups? Well, maybe, as long as you
consider how to make pages that work on the WWW without images and style
sheets too. (How about working without JavaScript?)
<button type="button"><img src="unexistant"><span
style="display:none">commandbutton spare label for offsite
use</span></button>

would perform better than a <input type="image" src="unavailable">
with a tooltip.
No reason to mess around with tooltips.

They both perform worse than <input type="submit">.

And <input type="image"> works on most browsers if you specify adequately
the attributes that might be used as textual replacements for the image
(alt, name, value).
Besides tooltips everywhere in the document can be
quite frustrating.
I did not mention any tooltips. Where did _you_ get the idea of putting
them everywhere?
I am against flashy title
tooltips, there is a status bar for that.
No it isn't. The status bar is for the browser to show the status.
Disturbing that classifies a page as nerdishly childish.
Sadly <input type="image"> is by constitution about submitting form,
not as <button type="button">...
You didn't mention what kind of a button you have. On the WWW, it is best
to try and make all buttons submit buttons so that you can have a server-
side backup, even if you normally use client-side scripting for the
actions invoked by the buttons. If that's not feasible, make them look as
much like normal default-style buttons as possible. And that's quite
possible: you simply use <input type="button">, naturally in code that
has been generated by client-side JavaScript code and with an explanation
in a <noscript> element, to avoid frustrating users that are using
JavaScript-disabled browsers. The key point is to do nothing in order to
change the appearance, to maximize the odds that people understand
buttons as buttons and not as fancy decoration or something.
Yes it can be WAd via JS, but thats
overhead.
Yr abbrs r probly bout something off-topic.
Well those images for buttons would actually be different in web
application, thus for earch image a style class is too much. As icons
are much easily to be changed in serverside scripting templates than
in CSS (which just adds too much complexiti and dependancies)


Sorry, that does not parse either. If you had originally posted a URL
that demonstrates the context and problem, maybe some specific advice
could have been given.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Jul 20 '05 #6
Christoph Paeper <ch**************@nurfuerspam.de> wrote:
I haven't checked, but hasn't 'button' to be a descendant of a
'form', too?


No. All form fields may syntactically appear outside <form> elements too.
Mostly it does not make sense, but there are special cases like
<input type="button"> or <button type="button"> without server-side
backup. However some old browsers fail to render form fields outside
<form> elements.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Jul 20 '05 #7

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

Similar topics

10
6536
by: Noah Spitzer-Williams | last post by:
Hello guys, I'm itinerating through my array using pointers in this fashion: image is unsigned char image do { cout << "image byte is: " << *image << endl;
5
35673
by: JohnSouth | last post by:
Hi I've an image submit button on a form that needs to appear flat on the surface. I can't get rid of the shadow that appears bottom and right. This is the best I can do. <code>...
2
3479
by: Matt | last post by:
In the following code, I have 2 questions regarding submit button with image. 1) Does this code <input type="image" name="populate" src="populate.gif"> behave the same as an HTML submit button...
8
1344
by: dev | last post by:
hey all, i have this demo code: <script> tog=0; function setvalue(id){ if(id){ tog=1 }else{ tog=0;
14
2146
by: frizzle | last post by:
Hi there, I have a form on a contact page, and to make the layout cross-browser/-platform i want to use an image as a button instead of using an image as background on a button.... Problem:...
6
16109
by: bonAveo.net | last post by:
Hi, I got 3 buttons with 3 different values... > <input type="image" src="search.png" value="http://jigsaw.w3.org/css-validator/validator?usermedium=all&uri=" onclick="addUrl(this.value)"> >...
7
1438
by: John Smith | last post by:
As it is now apparently illegal in the UK to produce a website which is inaccessible to the disabled, which includes the JavaScript-disabled and images-disabled, am I right in thinking that the...
1
1061
by: russiandevil | last post by:
hi, Does anyone have an idea on how I'd go about highlighting (with a border, or something equally effective) a input button of type 'image' (i.e. <input type=image alt=Login src=http://<etc,...
3
5547
by: crazychrisy54 | last post by:
Hi there I just wondered if there is any way using GD to insert a clickable button or some clickable text into a image? It is possible to create images for buttons but what if you want a...
0
7157
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7379
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7535
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
5682
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4745
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3232
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3221
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1591
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
455
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.