473,379 Members | 1,187 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

Capitalize first letter in first <p>

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
Jul 21 '05 #1
3 23182
On Wed, 10 Nov 2004 15:35:55 +0100, news.individual.net
<ju*********@puntodepartida.com> wrote:
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.
body > p:first-child:first-letter {
The > above won't be understood by IE. Neither is first-child, if I recall
correctly.
PD: Something like this:
http://puntodepartidacom.siteprotect.net/example.gif


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;
}
Jul 21 '05 #2
*news.individual.net* <ju*********@puntodepartida.com>:

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).
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.
font-size: 270%;
line-height: 40px;
I guess that should be "1", which in this case shouldn't be
distinguishable from "100%" or "1em".
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
Jul 21 '05 #3
Sorry! My English is very bad :)

Thanks!
Jul 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: vertigo | last post by:
Hello How can i change big letter to small letter ? When i tried char=char+32 i received error that can not add int to sring. Thanx Michal
2
by: Eshrath | last post by:
Hi, What I am trying to do: ======================= I need to form a table in html using the xsl but the table that is formed is quite long and cannot be viewed in our application. So we are...
2
by: Donald Firesmith | last post by:
I am having trouble having Google Adsense code stored in XSL converted properly into HTML. The <> unfortunately become &lt; and &gt; and then no longer work. XSL code is: <script...
6
by: pmatos | last post by:
Hi all, Is there a way of (after creating a pair) set its first and second element of not? (pair is definitely a read-only struct)? Cheers, Paulo Matos
6
by: Paul Gorodyansky | last post by:
Hi, Question about event.altKey event.ctrlKey event.shiftKey If I need to catch when a user does say Ctrl+Alt+G - somehow event.altKey is not working, i.e.:
1
by: RJN | last post by:
Hi I'm using XMLTextReader to parse the contents of XML. I have issues when the xml content itself has some special characters like & ,> etc. <CompanyName>Johnson & Jhonson</CompanyName>...
1
by: JezB | last post by:
I'm binding a DataGrid web-control to data fetched from a database. However some of my data fields contain text that is within <...> characters - I notice that everything between the <> is...
1
by: RJN | last post by:
Hi I'm using XMLTextReader to parse the contents of XML. I have issues when the xml content itself has some special characters like & ,> etc. <CompanyName>Johnson & Jhonson</CompanyName>...
3
by: ajay2552 | last post by:
Hi, I have a query. All html tags start with < and end with >. Suppose i want to display either '<' or '>' or say some text like '<Company>' in html how do i do it? One method is to use &lt,...
4
by: ezechiel | last post by:
Hi, while testing the program (runs in DOS), I thought "if someone hits enter without typing a letter before, what happens?" I tested and the script ends.. Is this normal, or how can I avoid this?...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.