CSS - Font Size Problem In Opera - Fonts Are Huge For No Reason! Halp!
Hi guys,
I'm working on a layout for a client, and I've run into a problem I've never seen before. My code is fully valid CSS (except for the *html IE fixes) and fully valid transitional XHTML, and it works fine in FF, IE and even Safari - but as soon as I load it up in Opera, it breaks completely. The font size is absolutely HUGE for some reason (like 400% of normal!), and it is completely breaking my layout. I have no idea why this would be happening, and it's immensely annoying. I'm setting all of the font sizes throughout the page in ems, and at the start of the css I declare the following: Code: html, body { height: 100%; margin: 0px; padding: 0px; text-align: center; font: 62.5% Tahoma, Verdana, Arial, Sans-Serif; /* Resets 1em to 10px */ background-color: #000000; } Now this should be fine, and indeed it works in every other browser.. but Opera is wigging the hell out, and I don't know what's wrong. Has anybody ever experienced anything like this? If so, please let me know! I'm hesitant to post the full code because it's covered by a hefty NDA, but I can strip out confidential bits if needed. Thanks everyone! Similar TutorialsI have set font size to 8px, and IE, FF, Safari and Chrome all respect this and size the font to the value in question, but Opera refuses to comply. When I tested it, I've found out it wont show fonts that are smaller than 10px or 1em. Is there a way to force Opera to display fonts less than 10px or 1em? So i just wrapped up some initial styling for a personal website i'm working on, http://www.sociospatial.com/ Looks fine in firefox. Has some minor issues in chrome/webkit, which I'll iron out later. Haven't dared to load it up in IE yet. In Opera, though, I'm having a problem that I don't know where to start. So without having to paste alot of code, I have a wrapper div and a footer div, just so that I can have the footer hug either the bottom of the viewport or the bottom of the page, whichever is lower. I also wanted some background elements to the page, but I wanted them to hug the bottom as well (load up the page in firefox and resize to viewport to see), so I ended up with something like this: Code: <div id="footer"> <span id="left-bg"></span> <span id="right-bg"></span> </div> and the styling for these is something like (I can post the actual/more if need be) Code: div#footer { position: relative; height: 25px; width: 100%; } span#left-bg { position: absolute; left: 0; bottom: 0; width: 400px; height: 600px; background: transparent url(some-url.png) no-repeat 0 0; z-index: -1; } span#left-bg { position: absolute; right: 0; bottom: 0; width: 400px; height: 600px; background: transparent url(some-url.png) no-repeat -400px 0; z-index: -1; } in firefox/webkit at least, these function as i want, so I have 2 spans that spill up through the top of the containing footer div, but still hides behind normal content. If my wrapper content is minimal, it appropriately hugs the bottom of the viewport and i don't have any vertical scrollbar. If I have a lot of content in the wrapper, I have a vertical scrollbar, but the footer and the spillout background elements are all waiting for me at the bottom of the page. in opera (9), the two spans hug the bottom of the (initial) viewport as I would hope, but I *do* have a vertical scrollbar (even when the content in the wrapper does not necessitate it), and scrolling down reveals that I have a *huge* amount of space that's just empty body background below the footer. This empty space seems vaguely correlated with the "height" values of the spans (the lower the height value, the smaller the empty black background space under the footer), and the vertical scrollbar goes away completely under one of these conditions: a) i add "overflow:hidden" to the div#footer styling (but of course this stops the span elements from spilling through the top) b) using the W3-dev opera tools, if I disable both spans c) after I disable both spans, I enable only one or the other (if I just disable one after both have been enabled, the vertical scrollbar stays, so I have to disable both first). i'm not quite sure what exactly is going on here, nor really what issue I'm trying to track down (I don't know what to enter for a google search, for example) - I'm kind of new at this. Anyone have any clues to contribute? I'll add more information if needed. Hello, I have a code below which works fine in IE and Firefox. However in Opera the 4 boxes are displayed in a 2x2 form insetad of 4x1. Any idea? Code: <!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"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <style type="text/css"> #container { margin: auto; padding:0px; width: 980px; border: 1px solid #000000; } #center { margin: 0px; padding: 0px; clear:both; } #left_panel { width: 240px; float:left; border:1px solid #ff0000; } #main_panel { padding: 0px; margin: 0px; margin-left:295px; width:660px; border:0px solid #ff0000; } #main_panel #main_panel_header { padding-top: 5px; border:1px solid #ff0000; overflow:hidden; } #main_panel_header .photo_box { float:left; background-color:#000000; } #main_panel_header .photo_box img { background-color: #000000; height: 115px; width: 140px; border:2px solid #000; border-bottom:0px; margin:0px; } #main_panel_header .photo_box a{ color: #ffffff; text-decoration:none; font-size:10px; font-weight:bold; display:block; text-align:right; text-transform: uppercase; width:140px; float:left; padding:2px; margin:0px; background-color:#000000; } </style> </head> <body> <div id="container"> <div id="center"> <div id="left_panel"> Menu1<br/>Menu1<br/> </div> <div id="main_panel"> <div id="main_panel_header"> <div class="photo_box"> <img src="style/tmp/pic.jpg" /> <a href="#">Link</a> </div> <div class="photo_box"> <img src="style/tmp/pic.jpg" /> <a href="#">Link</a> </div> <div class="photo_box"> <img src="style/tmp/pic.jpg" /> <a href="#">Link</a> </div> <div class="photo_box"> <img src="style/tmp/pic.jpg" /> <a href="#">Link</a> </div> </div> </div> </div> </div> </body> </html> Hello all. THis is my first post here . I use em to define font-size at my site. At main css file... body { font-size: 76%; } tr, p, div, td, div { font-size: 1em; } at secondary css file... div#content_area .contentpaneopen { font-size: 1.1em ; line-height: 1.3em; } The problem is that the text (content_area) displays correctly on firefox and Opera and wrong on IE. I need em because i use a auto font resize javascript file.I am trying to find what is wrong for days...! please check at this link... I am sorry about the greek encoding Thank you Hi, This is only happens in IE, in firefox (the only 2 browsers I tested) works fine. http://nazgulled.no.sapo.pt/test.html There's only one image inside the <div> tag, and I have set that div tag style to have a 10px height. But that doesn't work on IE... it's like there were some spaces wich because of the font-size it makes the height be more than 10px.... I wanted to fix that but how can I do it? One solution is to make the div tag like this: Code: <div id="test"><img src="spect.gif" width="300" height="10" /></div> instead of this: Code: <div id="test"> <img src="spect.gif" width="300" height="10" /> </div> But I don't want to fix it that way... Any help would be hot, thanks. I have the following CSS styles: Code: #content p { font-size: 24px; } .smalltext p { font-size: 12px; } Then, I create a #content div in my HTML with three paragraphs in it. I want the middle paragraph to have the .smalltext class, like this: http://www.toprival.com/temp/css_question.gif With the CSS the way I have it, the font size (12px) of the .smalltext paragraph is ignored. But if I change the CSS so both selectors are IDs, or so both are classes (and update the HTML accordintly), it works. Why is that? Having a strange problem with textarea font sizes in Firefox (1.06) See here - http://www.4L.ie/contact.php Text entered in the text fields is appearing correctly, but when entering text into the "Your Query" textarea, the font-size is noticeably smaller and less legible. It appears fine in IE6. My CSS relating to fonts is as follows: Code: body { font: 76% verdana, arial, helvetica, sans-serif; } input, select, textarea { font-size: 1em; } If I use pixels (ie font-size: 12px) there is no problem. Ems and % seems to mess things up. Anybody able to shed some light on this? A possible bug in Firefox 1.06? Thanks in advance. Hi everyone. Here is the url http://v3p2.stealthwd.ca/ its the dev version of my companies soon-to-be-new website. The font-face code is... Code: @font-face { font-family: 'SlingLight'; src: url('/fonts/sling/slinglight-webfont.eot'); src: url('/fonts/sling/slinglight-webfont.eot?#iefix') format('embedded-opentype'), url('/fonts/sling/slinglight-webfont.woff') format('woff'), url('/fonts/sling/slinglight-webfont.ttf') format('truetype'), url('/fonts/sling/slinglight-webfont.svg#SlingLight') format('svg'); font-weight: normal; font-style: normal; } Any idea why its timing out? Thanks Hi there, I'm completely new to CSS. I'm trying to do this more than one hour but can't get it right. Code: <font color='white'><font size='1' face=verdana size=1> I couldn't find the equivalent of this in CSS This is my last experiment but it doesn't seem to work either Code: fontstyle { color : #FFFFFF; font-family : verdana ; font-size :1;} Thanks So when using Netscape 7.2 & Opera 7.5 and MSIE 6.0, How do you get a simple tag like body { font-size:small; } to be equal in all browsers? Setting IE Text Size to Medium, and Opera's Zoom to 100% (both defaults) and Netscape 7.2 to 120% (not the default) is one way, but is there a CSS way? By the way, the child element hack "body>div {property}" wasn't working no matter what I tried, by not working I mean to say Netscape never would read it or apply it. It appeared to be that Opera & IE need to read the same value while Netscape needs to apply a larger size to be equal to IE's and Opera's rendering. B I used to be better at this, but never used to care how things looked in other browsers. Now I'm so confused about what I'm doing wrong that I've second-guessing every action I take, and can't make sense of something... I've got a very simple header-content-footer (footer is essentially header tacked onto bottom) that works more or less how I'd like, but when viewing in Opera 9.5 the Georgia font I'm asking looks utterly crap. Please have a look at Firefox 3 or IE 6+ for how I want it to look. It's essentially the standard <h1> font setting for most Wordpress templates. What am I doing wrong??? site -- littlebee.gq.nu Thank you sincerely for your help. I'm regressing to extreme beginner here -- can't seem to get it to work even when creating a document focusing only on the body and text attributes... Whats the best way to fix font size? I use CSS. The font size seems to stay fix on IE but not on Mozilla and Netscape. Also I notice when I use adgui font it stay fix no matter in what browser and no matter at what text view. Why is that. Are there more of this kinda fonts? Bottom line, whats the best way to fix the size of fonts regardless of browser and at what text view. Thanks for you help Liz hi, someone using foxfire keeps saying the my font is really really tiny, I have my css file like:
Code: body { background: #FFFFFF; /* for internet explorer */ scrollbar-face-color: #FFFFFF; scrollbar-highlight-color: #FFFFFF; scrollbar-shadow-color: #FFFFFF; scrollbar-3dlight-color: #494969; scrollbar-arrow-color: #494969; scrollbar-track-color: #FFFFFF; scrollbar-darkshadow-color: #494969; margin: 0px; padding: 0px; border: 0px; border-top: 1px solid #8E9397; border-left: 1px solid #8E9397; font-color: #494969; font-family: Verdana,Arial,Helvetica; font-size: 8pt; text-align: left; } a:link,a:active,a:visited { color: #494969; text-decoration: none } a:hover { text-decoration: underline; color: #494969; position: relative; top: -1px; left: -1px; } hr { background: transparent; color: #494969; height: 1px; border-width: 0px; } fieldset { margin: 0; padding: 1px; border: 1px solid #494969; } legend { margin: 0; padding: 7px; color: #494969; background: transparent; font-weight: bold; } img { border: 0px; } table { background: transparent; } tr { background: transparent; } td { background: transparent; color: #494969; font-family: Verdana,Arial,Helvetica; font-size: 70%; } input, textarea, select { color: #494969; font: normal 11px Verdana, Arial, Helvetica, sans-serif; background: transparent; border: 1px solid #494969; border-style: inset; text-align: center; text-indent: 2px; } form { margin: 0px; padding: 0px; } any idea on whats wrong? and I would of changed the % to an actual value but I wanted to make it so people can control the size of the font to lager or smaller here is a preview with that css file in use : http://www.dbznetwork.net/ People viewing my site at 120 dpi are seeing misaligned text and layout, whereas people viewing the site at 96dpi can see it properly. I'm using "em" instead of pixels when setting font sizes in CSS. The site has fixed length and width, do I HAVE to allow it to resize itself? Hello, I have something has follows: <div> ... <table> ... </table> </div> My document font size is 1em. My div font size is 1.4em. What should be the font-size in my table to get back to the 1em of the document? Thanks, Miguel Well, the title might be a little oversimplified, but I guess it caught your attention In the past, I always set my font sizes using px. I know that this is not the appropriate standard (since it doesn't allow a user to re-size the font on their end), but I usually did it because it was easiest and most predictable. Now, I finally want to make the step towards more accessibility and I would like to learn a little bit more about using em's appropriately. Does anyone have any good advise on how to get started with the following questions: How/where do I set the initial font-size, from which I can use em's? What are the dangers of using em's instead of px? Where could this change impact my usual styling? Are there any good resources/tutorials about this? Any help/suggestions/ideas are appreciated... built a drop down using array... i did it this way so if they omit another item in page, the county they selected will reappear..but how do i change the font size of the county names in the array....they appear in such small print???? had posted in php forum, but someone suggested posting here... PHP Code: <table width="100%"> <? if( ($msgcounty == "e") && (isset($_POST['submit'])) ) {?> <tr> <td><font face="Arial, Helvetica, sans-serif" size="2" color="#ff0000"><b>County: </b></font> <? } else { ?> <tr> <td><font face="Arial, Helvetica, sans-serif" size="2" color="#000000"><b>County: </b></font> <? } ?> <? $county = array (1 => 'county', 'Adams County', 'Allen County', 'Wells County', 'White County', 'Whitley'); foreach ($county as $key => $value) { if ($countyselecter==$value) { $optionselected = "selected"; }else{ $optionselected = ""; } $selectcnty.= "<option value=\"$value\" ".$optionselected."> $value</option>\n";} ?><select name="countyselecter"> <? echo $selectcnty; ?> </select> </td> </tr> </table> Thanks for taking the time to read my question. I am setting the font size for this tag in CSS and it is showing up in different sizes depending on the browser. The font is bigger in FF than it is in IE7. My text fits in the desired area in IE7, but is way to big in FF. I have to be doing something incorrect here. Does anyone notice anything? Thanks, Brad HTML: Code: <p id="FillText">Click on an item under <strong>'Latest News'</strong> to read more about it here and get links to the full story...</p> CSS: Code: #FillText { font-size: 16px; color: #ffffff; height: 280px; padding-top: 20px; padding-left: 90px; padding-right: 15px; /*padding: 30px 34px 20px 96px; */ text-indent: 20px; } Hello: I'm building a website for a broad audience. I need there to be an option for text to be resized for those who have trouble with reading screens. I am trying to have the text on HTML pages be changeable through CSS. Two examples I offer are 1. wired.com 2. 1and1.com On the top right corner of the screen, there are options to change the text size without switching to a new HTML page. I believe this is done using CSS (perhaps Live StyleSheet Selector). I'm not really sure. I would like for the user the have the option to change the font-size by clicking, not by repositioning the window (then the size changing relative to window size). If anyone can help me, I would really appreciate it. Thanks! Deanna I have a style.css file included on all pages i want to sent default font and size, for all the text where i haven't already set something |