Prev: What means a blank between two Tags in CSS ? How to setup amargin top of a TABLE?
Next: FRAMEBORDER and BORDER in FRAMESET: How to avoid the gap?
From: Rapt0r on 17 Feb 2010 12:20 Can anyone please help to understand what it means CSS rule that makes all text 1.5 times larger than the base font of the system and colors the text red? What should i write or any one can help to write few codes here Confused!!
From: Nick Theodorakis on 17 Feb 2010 13:29 On Feb 17, 12:20 pm, Rapt0r <musht...(a)gmail.com> wrote: > Can anyone please help to understand what it means CSS rule that > makes all text 1.5 times larger than the base font of the system and > colors the text red? > > What should i write or any one can help to write few codes here > Confused!! Homework? Well, anyway... To apply these properties to all text in a given element such as <p>, you may write: p { font-size: 1.5em; color: red; background: white; } Note: always specify a background color if you choose a foreground color. You may also wish to assign properties to a class, e.g.: ..note { font-size: 1.5em; color: red; background: white; } Then ... <p class="note">Note: always specify a background color if you choose a foreground color.</p> .... in your html code. Nick -- Nick Theodorakis nick_theodorakis(a)hotmail.com contact form: http://theodorakis.net/contact.html
From: Ed Mullen on 17 Feb 2010 13:35 Rapt0r wrote: > Can anyone please help to understand what it means CSS rule that > makes all text 1.5 times larger than the base font of the system and > colors the text red? > > What should i write or any one can help to write few codes here > Confused!! > <style type="text/css"> body { font-size: 150%; </style> -- Ed Mullen http://edmullen.net Why is it that the guy who comes up behind you while you're waiting for an elevator presses the already-lit button as though he has some magical powers that you don't?
From: Beauregard T. Shagnasty on 17 Feb 2010 15:46 Ed Mullen wrote: > Rapt0r wrote: >> Can anyone please help to understand what it means CSS rule that >> makes all text 1.5 times larger than the base font of the system and >> colors the text red? >> >> What should i write or any one can help to write few codes here >> Confused!! >> > > <style type="text/css"> > body { > font-size: 150%; color: red; } <----------------- > </style> Don't forget the color and the closing brace! ;-) That will do it, Rapt0r, but who wants to read a whole page in "header format?" In red. Surely, you have a better question. -- -bts
From: Jukka K. Korpela on 17 Feb 2010 16:52
Nick Theodorakis wrote: > On Feb 17, 12:20 pm, Rapt0r <musht...(a)gmail.com> wrote: >> Can anyone please help to understand what it means CSS rule that >> makes all text 1.5 times larger than the base font of the system and >> colors the text red? [...] > Homework? Probably. And it seems that even c.i.w.a.s. regulars fail in it. It's probably not a useful assignment, though, but a clever student can learn from poor teaching too. > Well, anyway... To apply these properties to all text in a given > element such as <p>, Wait a second... the assignment said "all text". > p > { > font-size: 1.5em; > color: red; > background: white; > } No, that's not a right answer. > Note: always specify a background color if you choose a foreground > color. A good principle indeed, but was in the assignment? I would say that it was implicit in the assignment that the rule should have the given effects and only them. It does not help to replace p with body. It would only set properties for the body element. Browser style sheets could still set other properties for other elements, and in fact, they usually do. Typically, elements like code and pre have reduced font size by default. It seems that the correct answer is that no single CSS rule suffices. You would need two rules: body { font-size: 150% !important; } * { font-size: 100%; color: red !important; } Of course, usual CSS caveats still apply. But the above appears to maximize the odds of achieving the goal that was set. The goal was very absurd in any normal authoring context, but that's beside the point. -- Yucca, http://www.cs.tut.fi/~jkorpela/ |