This question already has answers here:
Styling <select> tag for iPhone
(4 answers)
Closed 3 years ago.
I am writing a webpage and sometimes the "picker" wheel on select elements scales the font down so that it can all be read and sometimes it just puts the "..." in the text to shorten it but leaves the size of the font untouched.
Is there a way to specify which method is used? I would like the font size to be scaled appropriately.
Thanks!
You use the picker data source method that returns a view, not a string. In the view you put a label, and set the font options as you want there:
– pickerView:viewForRow:forComponent:reusingView:
Related
This question already has answers here:
Change Select List Option background colour on hover
(13 answers)
Closed 2 years ago.
Is it possible to change this blue color of hovered select options, or is it browser specific?
My recommendation is to use an external library for doing this. The native select is very hard to style, and get it working properly across all browsers. I have previously used custom-select, and it has served me pretty well. Furthermore, there is a plugin for twitter-bootstrap that I haven't used myself, but may be what you're looking for.
This question already has answers here:
repeat css background image a set number of times
(7 answers)
Closed 2 years ago.
I know how to make a tiled background in HTML using the repeat element, but I was wondering if I could get the image to repeat a certain number of times? Is there any way I can control that...?
Sadly, there is not CSS option for this, The best hack you could get is to make more divs with this background and have them placed where you need them.
I have also heard that there is a way to do it with jquery, but that is beyond my knowledge, so you could look there.
This question already has answers here:
Access 'data-' attribute without jQuery
(5 answers)
jQuery: get data attribute
(5 answers)
Closed 5 years ago.
There's this pack simulator on a website I frequent. You are randomly given 10 basketball players in the game with various values on how much they are worth. When you load the page, the cards are face down so you have to click on each one to "reveal" the card and add to your total. The idea is to maximize the value of each pack.
I figured out that the flipping is all show and the total pack score is actually there as soon as you load the page. So I'm trying to write a greasemonkey script to refresh the page until the value is above a certain threshold. I can get to the span with this code:
document.getElementsByClassName("pack-score")[0];
which gets me a span that looks like this:
<span class="pack-score" data-score="12352">
So how would I access the data-score value inside that span, so I can then use it as a value for the code logic?
document.getElementsByClassName("pack-score")[0].getAttribute('data-score')
or in jquery
$(".pack-score").find('span').data('score')
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
How can I determine what font a browser is actually using to render some text?
My CSS style goes as "font-family: helvetica, arial, sans-serif;" for the whole page. It looks like Verdana is being used instead on some parts. I need to somehow verify this.
I've tried copy-paste from my browser into MS Word, but the font is not preserver.
Is there some tool to determine which font is actually being rendered for a page or section of text?
Firebug gives me the list of fonts as above, but I don't see a way to determine which one of the fonts is being used.
Basically, an element is set to use a specific font . If the font set for the element does not exist, it takes the font of the parent element. So, what they do is measure the width of the rendered string. If it matches what they expected for the desired font as opposed to the derived font, it's present.
Here's where I saw it: Javascript/CSS Font Detector (ajaxian.com; 12 Mar 2007)
Also, The FontFinder plugin for Firefox does exactly what you want. After installing, highlight a block of text, right click and go to FontFinder -> Analyze Selection. It will tell you the actual font being used as well as a other information like font-family, spacing, color, etc.
Yes offcourse! You can use firebug a built-in tool in firefox and chrome.
http://getfirebug.com/enable
This question already has answers here:
How to use square cursor in a HTML input field?
(6 answers)
Closed 6 years ago.
I want to have a custom text caret in my text field for my web page. I would like to have an old school block type blinking caret. Is this possible?
The simple answer is you can't (change the user's blinking caret) via javascript, html, or css as that is created and managed by the chrome (the browser beyond the DOM)
Wanna fake it?
http://www.dynamicdrive.com/forums/showthread.php?t=17450
The code examples shown are pretty old, but the idea remains the same-- Make a blinking box and have it tail the input...
With thats all said, I highly suggest against using it in anything but the smallest, niche, 'for fun' way as having a javascript function fire and be altering the DOM on every keyDown is bordering on user abuse imho.