HighDots Forums  

Setting button background image

alt.html.tags alt.html.tags


Discuss Setting button background image in the alt.html.tags forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Martin
 
Posts: n/a

Default Setting button background image - 02-12-2004 , 09:08 AM






Hi,

I want a load of buttons all with the same background image, but obviously
different labels.

I don't want to have to create tons of separate images, just to accomodate
the different labels. I would like to create one image as the button
"style", then use it in different buttons.

Is this possible?

Something like
<button style="background-image=images/but.gif">Hello</button> would be
nice, but doesn't seem to work.

1)Can anyone tell me how to do this?
It needs to work with the major browsers - ie latest IE and Netscape.

2)Also tips on how best to set the url for this button would be nice. I
guess surrounding it with a anchor tag would do, but is that best? The
button is not part of a form.

3)Also is it possible to specify if the button is raised or flush with the
rest of the page?

Thanks alot
Martin



Reply With Quote
  #2  
Old   
Martin
 
Posts: n/a

Default Re: Setting button background image - 02-12-2004 , 09:18 AM






Found this page

http://www.javascriptkit.com/howto/button2.shtml

That suggests this,
<button style="background-image:url(b6.gif)"><b>Under the Sea</b></button>

but it doesn't seem to work with IE6 :-(

Still looking for a solution...

Martin



Reply With Quote
  #3  
Old   
Martin
 
Posts: n/a

Default Re: Setting button background image - 02-12-2004 , 09:31 AM



Okay, the answer to the background image seems to be

<button style="background:url(b6.gif)"><b>Under the Sea</b></button>.

But I have 2 more questions now...
1) How can I get rid of the border of colour around the button?
2) How do I change the shape of the button, so it has rounded ends left and
right?

Thanks again
Martin

"Martin" <x@y.z> wrote

Quote:
Found this page

http://www.javascriptkit.com/howto/button2.shtml

That suggests this,
button style="background-image:url(b6.gif)"><b>Under the Sea</b></button

but it doesn't seem to work with IE6 :-(

Still looking for a solution...

Martin





Reply With Quote
  #4  
Old   
Jukka K. Korpela
 
Posts: n/a

Default Re: Setting button background image - 02-12-2004 , 03:59 PM



"Martin" <x@y.z> wrote:

Quote:
Okay, the answer to the background image seems to be

button style="background:url(b6.gif)"><b>Under the Sea</b></button>.
That <button> does nothing. I suggest that you design the functionality
first, then worry about visual appearance. Especially since you will
notice that what functionality calls for is either links (if you are
actually trying to do some links) or <input type="submit" ...>. And for
them, the styling issues are different.

<button> is fundamentally broken on IE (implemented in a manner that
seriously violates the specifications), and completely unrecognized by
some browsers.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.