typography

CSS text-underline rendering difference between FF/IE and Chrome

蹲街弑〆低调 提交于 2019-12-22 12:37:46
问题 I have a question. In the following url I have a set of h1,h2 and p elements with their respective css styling. The h1 element has text-decoration underline. http://nostalgia.mx/light2.html Open the site with both firefox+ie and chrome and you'll notice the profound differences: 1.- firefox+ie make the underline proportional to the fontsize of the element being underlined, which is very smart. Google keeps it thin and un-proportional. 2.- firefox+ie 'fuse' or 'meld' the text itself with the

How to handle responsive images with vertical rhythm?

♀尐吖头ヾ 提交于 2019-12-21 17:37:18
问题 I'm developing an HTML page using Compass/SCSS and a vertical rhythm approach. I've set up a baseline and specified heights for paragraphs and headings in rem units. It works great and lays on a vertical rhythm grid nicely. However, I have a central image that takes 100% width of the column (I want it to be responsive and scale with the browser window). The problem is that this image breaks vertical rhythm because it's height is calculated dynamically according to the browser width and image

How to combine bold and italic in CSS?

牧云@^-^@ 提交于 2019-12-21 06:48:55
问题 This W3Schools tutorial taught me how to use the CSS font-style property to make text bold (equivalent to <b&g>this</b> in old-fashioned HTML) as well as how to make text italic (equivalent to <i>this</i> in old-fashioned HTML). However, I can't seem to find anywhere how to make text have both properties at the same time (equivalent to <b><i>this</i></b> in old-fashioned HTML). Is there a way to do this using pure CSS? I've tried this: font-style: italic bold; The result was that the page

How do I calculate a String's width in Ruby?

北慕城南 提交于 2019-12-21 04:50:11
问题 String.length will only tell me how many characters are in the String. (In fact, before Ruby 1.9, it will only tell me how many bytes, which is even less useful.) I'd really like to be able to find out how many 'en' wide a String is. For example: 'foo'.width # => 3 'moo'.width # => 3.5 # m's, w's, etc. are wide 'foi'.width # => 2.5 # i's, j's, etc. are narrow 'foo bar'.width # => 6.25 # spaces are very narrow Even better would be if I could get the first n en of a String: 'foo'[0, 2.en] # =>

Ideas for converting straight quotes to curly quotes

白昼怎懂夜的黑 提交于 2019-12-20 18:26:05
问题 I have a file that contains "straight" (normal, ASCII) quotes, and I'm trying to convert them to real quotation mark glyphs (“curly” quotes, U+2018 to U+201D). Since the transformation from two different quote characters into a single one has been lossy in the first place, obviously there is no way to automatically perform this conversion; nevertheless I suspect a few heuristics will cover most cases. So the plan is a script (in Emacs) that does something like the following: for each straight

align headings to same baseline, regardless following text?

若如初见. 提交于 2019-12-19 06:14:19
问题 is there a way to align first line of multiple headings of various size to the same baseline? Also regardless to the text that follows, which should be aligned as well. See picture at http://snapplr.com/snap/z1mw please EDIT: re-uploaded: alt text http://img144.imageshack.us/img144/7615/screenshot2010021722h53.png It seems to me the only solution is to put each heading and each body text into separate DIV and then with headings to play with padding-top or margin-top to align them (e.g. H1

Is it possibly to keep vertical rhythm using only css?

◇◆丶佛笑我妖孽 提交于 2019-12-18 10:56:32
问题 I'm developing a typography oriented wordpress theme[1], and I'm getting troubles with the in-line images. I can control every element and adjust it's line height, bottom margin, ecc, to keep the vertical rhythm. But since images pasted through the editor can have any height, they obviously disrupt all the following content. So the question is if it's possible using margin, padding, both or another solution, to make sure that independent of the image size it will adjust to the baseline. I

Is there a way to make a variable width font act like a fixed width font in HTML? [duplicate]

淺唱寂寞╮ 提交于 2019-12-17 19:58:17
问题 This question already has answers here : Force Non-Monospace Font into Fixed Width Using CSS (8 answers) Closed last year . Is there a way to make a variable width font act like a fixed width font in HTML? For example, if I have the sentence, "The quick grey fox jumped over the lazy dog" displayed in "Courier New", a fixed width font, it would be wider overall than if it was in a variable width font like, "Arial". I would like to use "Arial" instead of "Courier New" but have the characters

Line-height without units

夙愿已清 提交于 2019-12-17 18:37:50
问题 I saw people using line height without specifying a unit, like this: line-height: 1.5; What does the number represents? I'm guessing it's a ratio so is it like em ? 回答1: line-height@ Mozilla Developer Network has a very good explanation (and examples) which is a easier to understand compared to the line-heightCSS specification. line-height can have the value specified in one of the following ways line-height: normal | <number> | <length> | <percentage> In your case, you are using a <number>

PDF bleed detection

瘦欲@ 提交于 2019-12-17 06:55:09
问题 I'm currently writing a little tool (Python + pyPdf) to test PDFs for printer conformity. Alas I already get confused at the first task: Detecting if the PDF has at least 3mm 'bleed' (border around the pages where nothing is printed). I already got that I can't detect the bleed for the complete document, since there doesn't seem to be a global one. On the pages however I can detect a total of five different boxes: mediaBox bleedBox trimBox cropBox artBox I read the pyPdf documentation