I want my submit buttons + links to appear as buttons and the same in all browsers.
Firefox 3.5 plays well. But IE6,7,8 have different views. Can you help me with this (apparently) simple task?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" /> <title>Crossbrowser css submit button, links</title> <style type="text/css"> button { background:#FFE900; color:#000; padding:3px 5px 3px 5px; border:1px solid #000; } input { background:#FFE900; color:#000; padding:3px 5px 3px 5px; border:1px solid #000; } a { background:#FFE900; color:#000; padding:3px 5px 3px 5px; border:1px solid #000; text-decoration:none; } </style> </head> <body> <a href="#">Buy now</a> <input type="submit" value="Buy now" /> <button type="submit">Buy now</button> </body> </html>
You can replace the Submit button with an image just like you do, with a background image for the link. Just get rid of the background and border, put the background url in the input selector and give it the correct width and height.
input{ background-color: white; border: 0; background-image: url('blah.png'); }
For buttons instead type="submit"use type="image".
type="submit"
type="image"
For example:
<button type="image" src="path_to_your_image.png">Buy now</button>
css :
background-image: url('path_to_your_image.png');
, , , Firefox 3.5 .
, . , - ( "" ), URL-, , , , .
IE6 7 .
CSS (<button> <input>):
<button>
<input>
overflow: visible;
IE6/7, - , visible . - , , , IE6 IE7.
visible
CSS . , , :
display: inline-block;
, , - . , ( , ), , . , . , , , , . ( , , firefox .) , -. , .
If you need a consistent look, you need to use the send image button.
You can always use the JavaScript framework to replace an element with a more stylish one or use MSIE conditional comments for a browser-specific style.
The sad truth is that cross-browser pixel perfection seems impossible with pure CSS and buttons.
Source: https://habr.com/ru/post/1712943/More articles:Is an HttpContext.Current object even if an exception is thrown? - c #Can a function of an enumerated type be declared? - c ++Using jQuery to work around tabindex problems - javascriptLive domain models => Ineffective? - performanceCan you offer any advanced examples of creating object-oriented software? - pythonlibrary for analyzing relative dates (such as a Google calendar) in C # - c #https://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1712945/any-reason-why-an-aspnet-20-application-with-no-code-would-take-2-minutes-to-load-on-first-run&usg=ALkJrhibjMPK0JG0-NBI4UwNB0zGfVqRFQZSH Case-Insensitive Aliases - linuxgetting an error not all code paths return a value using C # compiler - stringhttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1712948/disable-tab-access-to-control-in-winforms&usg=ALkJrhjXEGWGRKS2GefN3Tw1nb671aQJQgAll Articles