control font size of google autocomplete results

I am making a mobile web app, and I have made the buttons and fonts very large to be good for viewing on a mobile phone. I am using google's autocomplete on an address input field and an html5 datalist. It works, but the results come back too small to be read. How can I change the size of the results? Here's my code

function getGoogleAddressesNew() {
    getAddressesNew();
    var autocomplete = new google.maps.places.Autocomplete($("#address")[0], {});
    var places = $("#addresses").load(autocomplete);
    $("#addresses").append(places);
}

Open in new window


<div id="newOrder">
            <div>PHONE</div>
            <div><input id="phone" type="tel"/></div>
            <div>AMOUNT</div>
            <div><input id="amount" type="number" step="any" /></div>
            <div>ADDRESS</div>
            <div>
                <input id="address" type="text" style="width: 100%" list="addresses" onkeydown="getGoogleAddressesNew();" onfocus="getAddressesNew();" />
                <datalist id="addresses" style="font-size:48px"></datalist>
            </div>
            <div class="submitButtons">
                <div id="addNew" class="button floatLeft" onclick="addItem(); hideNewOrder();">ADD</div>
                <div id="addCancel" class="button" onclick="hideNewOrder();">CANCEL</div>
            </div>
        </div>

Open in new window

LVL 9
BobHavertyComhAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Rainer JeschorCommented:
Hi,
based on the API documentation from here the following classes can be used to style the autocomplete and searchbox:

pac-container      
The visual element containing the list of predictions returned by the Place Autocomplete service. This list appears as a dropdown list below the Autocomplete or SearchBox widget.

pac-icon      
The icon displayed to the left of each item in the list of predictions.

pac-item
An item in the list of predictions supplied by the Autocomplete or SearchBox widget.

pac-item:hover      
The item when the user hovers their mouse pointer over it.

pac-item-selected
The item when the user selects it via the keyboard. Note: Selected items will be a member of this class and of the pac-item class.

pac-item-query      
A span inside a pac-item that is the main part of the prediction. For geographic locations, this contains a place name, like 'Sydney', or a street name and number, like '10 King Street'. For text-based searches such as 'pizza in New York', it contains the full text of the query. By default, the pac-item-query is colored black. If there is any additional text in the pac-item, it is outside pac-item-query and inherits its styling from pac-item. It is colored gray by default. The additional text is typically an address.

pac-matched      
The part of the returned prediction that matches the user’s input. By default, this matched text is highlighted in bold text. Note that the matched text may be anywhere within pac-item. It is not necessarily part of pac-item-query, and it could be partly within pac-item-query as well as partly in the remaining text in pac-item.

HTH
Rainer
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
BobHavertyComhAuthor Commented:
Thank you. This is correct. However, small note, when you style this, only the new letters as they are added to the results are the right size. The already matched ones don't. It turns out that pac-item has a span for the display inside of it, so you need to style that for proper results, at least for the text.
.pac-item span {}.
Then it works great

Thanks again
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.