HighDots Forums  

Capitalize first letter in first <p>

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss Capitalize first letter in first <p> in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
news.individual.net
 
Posts: n/a

Default Capitalize first letter in first <p> - 11-10-2004 , 09:35 AM






Hi!

Can I capitalize the first letter of the first paragraph without using
a special class for that <p> ?

I tried it with this:

body > p:first-child:first-letter {

font-size: 270%;
line-height: 40px;
padding-right: 8px;
float:left;
}

But didn't work.

Thanks!

PD: Something like this:
http://puntodepartidacom.siteprotect.net/example.gif

Reply With Quote
  #2  
Old   
Neal
 
Posts: n/a

Default Re: Capitalize first letter in first <p> - 11-10-2004 , 09:49 AM






On Wed, 10 Nov 2004 15:35:55 +0100, news.individual.net
<juanjeQUITA (AT) puntodepartida (DOT) com> wrote:

Quote:
Hi!

Can I capitalize the first letter of the first paragraph without using
a special class for that <p> ?
The shift key works well for me. Why is that not an option for you?
Capitalization of sentences is normally considered part of the content,
and shouldn't be done in CSS.

Quote:
body > p:first-child:first-letter {
The > above won't be understood by IE. Neither is first-child, if I recall
correctly.

I think what you really want is a drop-cap, not a repeat of the first
letter.

<p class="firstp">This is my paragraph.</p>

CSS:

p.firstp:first-letter {
font-size: 3em;
float: left;
}


Reply With Quote
  #3  
Old   
Christoph Paeper
 
Posts: n/a

Default Re: Capitalize first letter in first <p> - 11-10-2004 , 11:09 AM



*news.individual.net* <juanjeQUITA (AT) puntodepartida (DOT) com>:
Quote:
Can I capitalize the first letter of the first paragraph without using
a special class for that <p> ?
Like Neal's reply shows, your wording is misleading (but the sample code
isn't).

Quote:
body > p:first-child:first-letter {
A better catch is something like

h1 + p:first-letter {

because multiple pseudo-classes/-elements (':first-child' is the former,
':first-letter' the latter) are either prohibited or buggily implemented.
Doesn't work in IE either, of course.

Quote:
font-size: 270%;
line-height: 40px;
I guess that should be "1", which in this case shouldn't be
distinguishable from "100%" or "1em".

Quote:
float:left;
You need an explicit width with 'float' in CSS*2.0, something between
"1ex" and "1em" should do.

--
"You can only find truth with logic
if you have already found truth without it."
G.K. Chesterton


Reply With Quote
  #4  
Old   
news.individual.net
 
Posts: n/a

Default Re: Capitalize first letter in first <p> - 11-10-2004 , 11:18 AM



Sorry! My English is very bad

Thanks!

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.