html5: Input Field Using @fontface, non-system fonts. Is this possible
Quick question, is it possible to have a开发者_如何学编程n input field in a form use a non-system font in html5 and css3? So if someone types in the form field the text could be something like gotham?
Yes, it is possible. I just had to remove the @font-face font from a site that I applied it on or else I'd link to a working example for you.
Here's what I had for the CSS though:
@font-face {
font-family: 'QuicksandBook';
src: url('/media/fonts/Quicksand_Book.eot');
src: local('Quicksand Book'), local('QuicksandBook-Regular'), url('/media/fonts/Quicksand_Book.ttf') format('truetype');
}
html, body,
input, textarea {
font-family: QuicksandBook, Arial, sans-serif;
}
Nothing special to do here, just setup a @font-face
as normal:
@font-face {
font-family: "Delicious";
src: url("Delicious-Bold.otf");
}
.myinput {
font-family: "Delicious";
}
This works for me on Chrome for OSX
精彩评论