CSS - Relative, Non-breaking, Maximum Font Size
I'm creating a blog for someone, and my issue resides in <h2>.
Using Wordpress, <h2> is typically the blog entry title. As you know, blog entry titles vary, because people put in different titles for different entries. I have <h2> formatted to my friend's likings, but an issue has arisen. If a blog entry title is particularly longer than the average, <h2> breaks into another line of text. This results in corrupting the layout entirely. So my question: How do I go about formatting <h2> so that the blog entry title text fills up the entire width of <h2> without breaking into a new line? Clarification (if needed): I want the font size to be dependent upon the physical length of text in the blog title Here's my code for <h2>. It resides in two containers of sorts. Code: h2 { float:left; font-family:"Franklin Gothic Medium"; font-size:55px;letter-spacing:-2px; width:728px; padding: 0; margin: 0; } This is my first post/topic. Be gentle! Thanks. Similar TutorialsCode: <div class="container"> <div>Booya</div> </div> Code: .container { position: relative; } .container div { position: absolute; bottom: 0; right: 0; } Is there any way to position the nested div relative to its grandparent vs. its parent without losing the relative positioning, or is JS the only option? Code: #ticker { background: transparent url('../images/dark_gradient.png'); overflow: hidden; display: table; margin-left: 20px; margin-top: 10px; width: 835px; height: 52px; } #ticker #items { position: relative; top: 0px; left: 829px; } the point is to use javascript to scroll the #items div along the container (#ticker). now, using this method, overflow: hidden does not seem to be working correctly. (i know display: table only works in FF, but this is an internal tool, so no need to make IE fixes yet) ... now, when i change display: table to display: block, the overflow works, but now the #items div is no longer relative to the container, but relative to the window. 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 http://cad-design-engineering.com/New I double checked, and this page validates. (CSS and XHTML) The gray background on the right hand side - I can't adjust the width. When I do get a change, it breaks something - the links panel shifts to the bottom of the screen. Code: #container { width: 737px; height: 1%; overflow: visible; float: left; padding: 4px 0 0 0; margin-right: -185px; } This is the output from the Firefox Web Developer plugin: Code: #container (line 147) { width: 737px; height: 1%; overflow: visible; float: left; padding-top: 4px; padding-right-value: 0pt; padding-bottom: 0pt; padding-left-value: 0pt; padding-left-ltr-source: physical; padding-left-rtl-source: physical; padding-right-ltr-source: physical; padding-right-rtl-source: physical; margin-right-value: -185px; margin-right-ltr-source: physical; margin-right-rtl-source: physical; } Not sure what I'm doing wrong. I've been perplexed for several days on this one. Thank you. I was in a meeting today talking about relative font sizes and how they can be problematic, because nesting elements may increase or decrease their font size. A co-worker said that I could use !important in my CSS to override/ignore the font-sizes of any nested elements. He seems to be way off. The W3C says that !important is really just about user versus author stylesheets, and apparently declaring !important in an author stylesheet doesn't do anything. So first question -- am I right about !important? It's only about user and author stylesheets, yes? Second question -- When dealing with relative fonts and nested elements, you have to start writing pretty complex rules, right? Is there any easy way in CSS without writing multiple rules to say "regardless of what element I place you in, always be x% font size..."? I heard people complaining about "accessibility", so i finally designed a site with relative font sizes. my default font sizes are 90% of whatever the browser default would be. to my horror, i see that indented lists that contain indented lists get progressively smaller.... can someone suggest how to prevent this while still letting allowing variable font sizes? many thanks. dan hello is it possible to use css or some other artifice to make textarea/input elements adjust their row/col/size when the user increases/decreases the font size? i'm mostly talking about IE, because netscape/etc. seem to work it out just fine... setting a relative font-size for textarea/input elements on the stylesheet doesn't seem to do the trick. as usual, i tried looking around for info on this but found none, i'm beginning to think it just can't be done. any help would be really appreciated 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? 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 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... 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/ 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 Is there any way to limit how large a font can become in firefox and internet explorer? 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 Hi there, I have a font size problem. Basically, some of the text on the page appears as size 14 verdana, where as the other text appears how i want it. I want the text to be displayed as 11px tahoma. This is what i am using: PHP Code: BODY { margin:0px; padding:0px; font-family: tahoma, verdana, arial; font-size: 11px; } Also, some text is in a <p> tag. How do i define that? Many thanks ok so basically my MAIN browser is Opera which I use it 99% of the time. Now when I try viewing my site in Internet Explorer, font size looks SMALLER than the one I see in Opera. Of course the solution would be simple - bump up the font size but then the font looks TOO BIG in Opera. how to equalize these font sizes in both browsers? also, is this the correct usage for setting font size? Code: body,td,th { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; color: #000000; } a:link { color: #000000; text-decoration: none; } a:visited { color: #000000; text-decoration: none; } a:active { color: #000000; text-decoration: none; } a { font-size: 12px; } EDIT: this message I wrote right now, looks EXACTLY the same in both browsers. Fonts match up perfectly. what did the admin do for font property? I need to shrink the fonts for the following classes on blogspot: post-body date-header but for some reason it refuses to shrink below 100% or 1em Even in firebug, adding properties to element.style, the font refuses to shrink below 100%. Even when i switch off all inherited values for font values it refuses. It does however grow to any size larger than 100%. Other elements' fonts do shrink to any value, it is only these (and possibly others) that do not shrink. blogspot in question is http://secretfarts.blogspot.com Any ideas? Hi I have applied this style to a drop down. However, the font size only appears at 10px in FF and not IE. Any ideas why? <option style="font-family: Verdana; background: #E0EAF8; font-size: 10px;" value="link">link text</option> |