Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7615219
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T02:35:28+00:00 2026-05-31T02:35:28+00:00

This is the closest I’ve seen: Changing font-size with jQuery css() function is crashing

  • 0

This is the closest I’ve seen:
Changing font-size with jQuery css() function is crashing Chrome
But it didn’t help.

Other threads mentioned that it’s a bug in Webkit, but those were old threads and I couldn’t find the bug report on Webkit’s site.

The problem is that the header has a fixed width picture background and the navigation menu needs to stay within that width. I’ve since given up on HTML or CSS methods of accomplishing this. If you know of any, then please do share. So I’ve resorted to JavaScript (jQuery). And it works reasonably well, except in Chrome. The text actually increases in size for some odd reason.

Here’s the simplified code in JSFiddle:
http://jsfiddle.net/alininja/j4jD9/12/

This gist of the code is this line:

$('body').css('font-size',(content_size-1)+'px');

For FireFox and Opera, the text size decreases to fit the header width, but not in Chrome.

If I run JSFiddle in Chrome everything works, but the funny behavior shows up on the actual website. This is happening on Chrome 17.0.963.56.

Thanks in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T02:35:30+00:00Added an answer on May 31, 2026 at 2:35 am

    If you want presentation consistency cross browser there is more involved than just setting font-size. You are assuming other font property defaults such as font-family are the same cross browser which they are not.

    Use of a css reset will help

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the code var expired_overlay=$('.expired-overlay'); expired_overlay.each(function(){ var t=$(this), p=$(this).closest('.coupon'), ph=p.height()+ ((p.css('padding-top').replace(px, ))*2); t.css({'width':p.width(),'height':ph,'opacity':0.5})
Hi have the following function which works fine: jQuery('.btnRemoveItem').click(function(obj){ jQuery(this).closest('li').fadeOut(400, function() { $(this).remove(); });
I am using jquery function which changes the class of element $(a).click(function(){ $(this).closest(ul).find(a).parent().removeClass(active); $(this).parent().addClass(active);
I have the following jQuery code: $(.save_button).click(function() { var $form = $(this).closest(div.info_section).find(form); url =
In jQuery, I have the following: $('td').click(function(myEvent) { var local = { tr:$(this).closest('tr') };
Given this jQuery: $('div.MvcFieldWrapper :input').focus(function() { $(this).closest('label.MvcDynamicFieldError').fadeOut(); }); And given this HTML: <div class=MvcFieldWrapper>
I have the following jQuery: $(this).closest('div.mcoup').find('div.delcoup').slideToggle(400) .siblings().children('div.delcoup').slideUp(400); What I'm trying to do is get
I have the following function. $(function() { $(.sectionHeader:gt(0)).click(function() { $(this).next(.fieldset).slideToggle(fast); }); $(img[alt='minimize']).click(function(e) { $(this).closest(table).next(.fieldset).slideUp(fast);
I have been playing with this for a while, but the closest I have
I have: $('th a').click(function() { var $th = $(this).closest('th'); $th.toggleClass('selected'); How do I say:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.