473,396 Members | 2,024 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,396 software developers and data experts.

Drop cap with IE

I'll try this question again: I have a drop cap that works fine under
galeon, mozila, opera, but does not show up under IE.

#intro:first-letter {
margin-top: -0.1em;
margin-right: 0.2em;
margin-bottom: -0.2em;
float: left;
color: #CC0000;
font-weight: bolder;
font-size: 200%;
}
#intro {
...
text-align: left;
}

<div id="intro">
Documents to. . .

More specifically, the initial "D" is right where I want it with
galeon and Mozilla. It is placed about 25% too high under Opera. The
"D" appears only as a normal character under IE 5.

Does IE 5 support drop caps?

Any idea of how to tune so that Opera displays the same positioning as
Mozilla?

--
Haines Brown

Jul 20 '05 #1
10 2858
Haines Brown <br****@teufel.hartford-hwp.com> wrote:
I'll try this question again: I have a drop cap that works fine under
galeon, mozila, opera, but does not show up under IE.
It shows up in IE6 and IE5.5 but not in IE5.
IE 5.5 was the first (windows) version to support the :first-letter
selector.
#intro:first-letter {
margin-top: -0.1em;
margin-right: 0.2em;
margin-bottom: -0.2em;
float: left;
color: #CC0000;
font-weight: bolder;
font-size: 200%;
}
#intro {
...
text-align: left;
}

<div id="intro">
Documents to. . .

More specifically, the initial "D" is right where I want it with
galeon and Mozilla. It is placed about 25% too high under Opera. The
"D" appears only as a normal character under IE 5.

Does IE 5 support drop caps?
5.0 doesn't support first-letter. You have to hack the drop cap some
other way.
Any idea of how to tune so that Opera displays the same positioning as
Mozilla?


Opera 7.52 and Firefox 0.9 display it more or less the same. IE6 and
5.5 are slightly higher but not enough to worry about.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>
Jul 20 '05 #2
Steve Pugh <st***@pugh.net> writes:
Haines Brown <br****@teufel.hartford-hwp.com> wrote:
I'll try this question again: I have a drop cap that works fine under
galeon, mozila, opera, but does not show up under IE.

Does IE 5 support drop caps?


5.0 doesn't support first-letter. You have to hack the drop cap some
other way.


Well, thanks for the simple answer. I'll not worry about its absence,
for it is not all that important.
Any idea of how to tune so that Opera displays the same positioning as
Mozilla?


Opera 7.52 and Firefox 0.9 display it more or less the same. IE6 and
5.5 are slightly higher but not enough to worry about.


Interesting, based on your standard (Opera, Firefox), galeon and
Mozilla display it 25% lower. Again, not something to worry too much
about.

--
Haines Brown

Jul 20 '05 #3
Haines Brown <br****@teufel.hartford-hwp.com> wrote:
Steve Pugh <st***@pugh.net> writes:
Haines Brown <br****@teufel.hartford-hwp.com> wrote:
>Any idea of how to tune so that Opera displays the same positioning as
>Mozilla?


Opera 7.52 and Firefox 0.9 display it more or less the same. IE6 and
5.5 are slightly higher but not enough to worry about.


Interesting, based on your standard (Opera, Firefox), galeon and
Mozilla display it 25% lower. Again, not something to worry too much
about.


Hmm, I've tried it in Opera 7.23, Opera 7.52, Netscape 6.2.3 (hence
Gecko 0.9), Mozilla 1.7.1 and Firefox 0.9.2 (both Gecko 1.7) and the
position of the drop cap is the same in all of them - the baseline of
the dropped letter is just below the top of the lowercase letters on
the second line of the div.

So either some other styles which you didn't quote are causing the
difference or there's something else going on with your copy of Opera
that causes it to behave differently.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>
Jul 20 '05 #4
Steve Pugh <st***@pugh.net> writes:
Haines Brown <br****@teufel.hartford-hwp.com> wrote:
Steve Pugh <st***@pugh.net> writes:
Hmm, I've tried it in Opera 7.23, Opera 7.52, Netscape 6.2.3 (hence
Gecko 0.9), Mozilla 1.7.1 and Firefox 0.9.2 (both Gecko 1.7) and the
position of the drop cap is the same in all of them - the baseline of
the dropped letter is just below the top of the lowercase letters on
the second line of the div.


Thanks for the specific info. It's a help.

It seems that your suspicion there's other coding that is having
influence is probably correct, for on my Opera 7.52, I don't quite get
the same position of the "D" as on your copy. The baseline of the
dropped letter is just _above_ the top of the lowercase letters on the
second line of the div.

On that assumption, I hestitate to burden you with more specifics, for
it's like looking for a needle in a haystack, and the proper approach
should be to start with a very simple test page and then develop it
bit by bit until its no longer matches your result.

Given that here's some of the tags. I've cut out what obviously is
irrelevant:

body {
width: 640px;
margin-left: auto;
margin-right: auto;
text-align: center;
...
}
#IE-hack {
width: 640px;
text-align: left;
margin: auto;
}

/* Now comes the first div on the page. It nests two other
divs */
#graphics {
left-margin: auto;
right margin: auto;
text-align: center;
}

/* Now the paragraph with the Dropped letter, with complete
style definition */
#intro:first-letter {
margin-top: -0.1em;
margin-right: 0.2em;
margin-bottom: -0.2em;
float: left;
color: #CC0000;
font-weight: bolder;
font-size: 200%;
}
#intro {
width: 640px;
font-size: 0.9em;
margin-top: 1em;
text-align: left;
}

Now, in the body I have:

<div id="graphics">
<img id="graphic-a" src="bin/title-a.gif" ...
<br />
<img id="graphic-b" src="bin/title-b.gif" ...
</div>
<div id="intro">
Documents to support ...

So the coding is quite simple. I did not put the "intro" paragraph
into a paragraph container.

--
Haines Brown
Jul 20 '05 #5
Haines Brown <br****@teufel.hartford-hwp.com> wrote:
Steve Pugh <st***@pugh.net> writes:
Haines Brown <br****@teufel.hartford-hwp.com> wrote:
>Steve Pugh <st***@pugh.net> writes:
Hmm, I've tried it in Opera 7.23, Opera 7.52, Netscape 6.2.3 (hence
Gecko 0.9), Mozilla 1.7.1 and Firefox 0.9.2 (both Gecko 1.7) and the
position of the drop cap is the same in all of them - the baseline of
the dropped letter is just below the top of the lowercase letters on
the second line of the div.


Thanks for the specific info. It's a help.


At least you knew what I meant. 'lowercase' is totally the wrong word
to use here but my brain is refusing to supply the word I'm looking
for. I meant the small letters, the ones without ascenders, there must
ba name for them?
#graphics {
right margin: auto;
You're missing a hyphen there.

#intro {
margin-top: 1em;


This is the most likely candidate. The combination of vertical margin
collapsing and floats is probably a deadly one. Very few browsers
handle either of them 100% correctly on their own, and together...

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>
Jul 20 '05 #6
Steve Pugh wrote in
<rb********************************@4ax.com>

<snip>

At least you knew what I meant. 'lowercase' is totally the wrong word
to use here but my brain is refusing to supply the word I'm looking
for. I meant the small letters, the ones without ascenders, there must
ba name for them?


x-height characters?

--
PeterMcC
If you feel that any of the above is incorrect,
inappropriate or offensive in any way,
please ignore it and accept my apologies.
Jul 20 '05 #7
Steve Pugh <st***@pugh.net> writes:
Haines Brown <br****@teufel.hartford-hwp.com> wrote:
Steve Pugh <st***@pugh.net> writes:
Haines Brown <br****@teufel.hartford-hwp.com> wrote:
>Steve Pugh <st***@pugh.net> writes:
#graphics {
right margin: auto;
You're missing a hyphen there.


Thanks. Didn't notice that. Apparently the line is optional.
#intro {
margin-top: 1em;


This is the most likely candidate. The combination of vertical margin
collapsing and floats is probably a deadly one. Very few browsers
handle either of them 100% correctly on their own, and together...


Useful to know, but cutting out the margin didn't significantly change
the position of the letter.

I did what I should have done initially, which is to create an
elementary test page with nothing but the dropped cap. Here is its
entire style definition and body:

#intro:first-letter {
float: left;
color: #CC0000;
font-size: 200%;
}
#intro {
text-align: left;
}

<div id="intro">
Documents...

Playing with this showed me that the 200% is not being intrepreted
quite the same. In my three browsers (galeon, mozilla, opera), the top
of the "D" is about the same, just a hair higher than the x-height of the
first line. But in the former two, the base line of the D is the
middle of the x-height of the second line, while in opera, it is a bit
higher than the x-height of the second line.

I played with the font-size definition, but found whether it was 2em,
200% or 24pt made no difference.

I started thinking about font metrics. The default font in galeon and
mozilla is times, and apparently opera as well.

It turns out that this was the problem. If I set font-family:
lucida; , the "D" is displayed exactly the same in all my
browsers: top of D exactly at x-height of first line, and baseline of
D at mid-x-height of second line. If I specify font-family as times or
serif, the inconsistency reappears as with the default family.

I'd go with lucida, but it shows up as too heavy, and I don't know what
families will be understood by all browsers. The weight of sans-serif,
times and garamond are ok, but I get the same problem as with default
times. I get the feeling that fiddling with font-families is a waste
of time because users may well set their own.

--
Haines Brown

Jul 20 '05 #8
Haines Brown <br****@teufel.hartford-hwp.com> writes:
Steve Pugh <st***@pugh.net> writes:
Haines Brown <br****@teufel.hartford-hwp.com> wrote:
Steve Pugh <st***@pugh.net> writes:
> Haines Brown <br****@teufel.hartford-hwp.com> wrote:
> >Steve Pugh <st***@pugh.net> writes: #graphics {
right margin: auto;


You're missing a hyphen there.


Thanks. Didn't notice that. Apparently the line is optional.


And you have the words the wrong way round:
margin-right, not right-margin

It'll be optional in circumstances where it's obvious that it should
be auto. The CSS2 specification has a fairly clear (though quite long)
description of how all this gets calculated.

--
Chris
Jul 20 '05 #9
Haines Brown <br****@teufel.hartford-hwp.com> wrote:

Playing with this showed me that the 200% is not being intrepreted
quite the same.

I started thinking about font metrics. The default font in galeon and
mozilla is times, and apparently opera as well.


Ah, I'd set a font-family and font-size on #intro in my test case. As
I have different default fonts (and different default font sizes) in
my various browsers I would have seen even more disparity than you did
if I hadn't done this. I suppose that I assumed that as you were
asking about a difference of a few pixels that you had already set
things like this.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>
Jul 20 '05 #10
Steve Pugh <st***@pugh.net> writes:
Haines Brown <br****@teufel.hartford-hwp.com> wrote:

I started thinking about font metrics. The default font in galeon and
mozilla is times, and apparently opera as well.


Ah, I'd set a font-family and font-size on #intro in my test case.


My #intro style had font-family defined, but not font-size. I can see
that it would be wise to do so, but it had no effect. Here's my
current state of the test file:

#intro:first-letter {
float: left;
color: #CC0000;
font-size: 200%;
}
#intro {
font-family: serif;
font-size: 1em;
text-align: left;
}

After getting a ruler out to actually measure things on my screen, I
find that the default line height for geleon and mozilla is 1.075em,
but for Opera it was significantly larger. On the theory this was my
problem, I defined line height in #intro, and Opera now has a line
spacing of bit over 5mm. compared to 5mm. for the others. So they are
now approximately the same.

Unfortunately, it also pushes the "D" in Opera up so that its base
line is appximately mid-line, and the second text line now justifies
left. The D was forced upwards to accomodate the second line reaching
the left margin. Oh, well ;-(

--
Haines Brown

Jul 20 '05 #11

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

Similar topics

6
by: PT | last post by:
I got a form with many text boxes, checkboxes and 3 drop downs. From that 3, 2 are dependant. I can choose one drop down, and the next drop down should display the dependant values of the first...
2
by: ehm | last post by:
I am working on creating an editable grid (for use in adding, deleting, and editing rows back to an Oracle database). I have a JSP that posts back to a servlet, which in turns posts to a WebLogic...
10
by: BuddhaBuddy | last post by:
Platform is DB2/NT 7.2.9 The table was created like this: CREATE TABLE MYTEST ( MYTESTOID bigint not null primary key, FK_OTHEROID bigint not null references other, FK_ANOTHEROID bigint not...
3
by: Ajay Krishnan Thampi | last post by:
I have a slight problem implementing 'drag and drop' from a datagrid to a tree-view. I have pasted my code below. Someone please advice me on what to do...pretty blur right now. ==code== ...
3
by: Don Wash | last post by:
Hi There! I have a Server-side Drop-down box in ASP.NET (VB) page. What do I do to widen the Drop down box's Pull-Down list's width? I'm not talking about the Drop-down box's width but the box...
2
by: Yoshitha | last post by:
hi I have 2 drop down lists in my application.1st list ontains itmes like java,jsp,swings,vb.net etc.2nd list contains percentage i.e it conatains the items like 50,60,70,80,90,100. i will...
6
by: jojobar | last post by:
Hello, I look at the asp.net 2.0 web parts tutorial on the asp.net web site. I tried to run it under firefox browser but it did not run. If I want to use this feature in a commercial product...
4
by: TycoonUK | last post by:
Hi, As I do not have IE7 on my computer, I was wondering if there is a fault in my CSS Menu when using IE7. Please can someone look at my site - http://www.worldofmonopoly.co.uk and tell me...
3
by: penny111 | last post by:
Hi there, For my application, i need to have 3 drop down lists 1. drop down list of folder names 2. drop down list of documents in the folder selected 3. drop down list of instances of the...
5
by: Romulo NF | last post by:
Greetings, I´m back here to show the new version of the drag & drop table columns (original script ). I´ve found some issues with the old script, specially when trying to use 2 tables with...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.