473,386 Members | 1,758 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,386 software developers and data experts.

Font discrepancy between tag and CSS

I've got a document that StarOffice converted into HTML, and I'm
trying to clean up the cuft that it generated. I put together some
basic styles, and tied using them: the results are puzzling. The style
definition is:

<STYLE>
<!--
@page { size: 8.5in 11in; margin: 0.79in }
div.res dl dt {
font-weight: bold;
line-height: 3;
text-decoration: underline; }
div.res dl dd { font-size: medium; }
div.res ul li { font: "Courier, serif"; }
.lead {
font-weight: bold;
line-height: 3;
text-decoration: underline;
text-indent: 0; }
.emp { font-weight: bolder; font-size: 1.2em; }
-->
</STYLE>

The StarOffice-generated HTML made extensive use of font tags, which I
am trying to eliminate.

<div class=res>

<p class="lead">
RECENT EXPERIENCE:
</p>

<p>
<span class="emp">name</span>,
address (dates):
</P>

<UL TYPE=DISC>

<LI>text</li>
<LI><P ><FONT FACE="Courier, serif">text
<LI><P ><FONT FACE="Courier, serif">text</FONT></P>
<LI><P ><FONT FACE="Courier, serif">text</P>
<LI><P ><FONT FACE="Courier, serif">text</FONT></P>
<LI><P ><FONT FACE="Courier, serif">text</FONT></P>
<LI><P ><FONT FACE="Courier, serif">text</FONT></P>
</UL>

Superficially it appear as though the text in the first li element
should be rendered the same as the text in the other li elements, but
it isn't. Also, if I try to include either of

font: "Courier, serif";
font-family: "Courier, serif";

in my definition of .emp, then it no longer renders in bold. Please
advise.

Note, this is not XHTML, so the missing ending tags (</font>, </p>)
should be legitimate.

--
Shmuel (Seymour J.) Metz, SysProg and JOAT <http://patriot.net/~shmuel>

Unsolicited bulk E-mail subject to legal action. I reserve the
right to publicly post or ridicule any abusive E-mail. Reply to
domain Patriot dot net user shmuel+news to contact me. Do not
reply to sp******@library.lspace.org

Jul 20 '05 #1
3 2153
"Shmuel (Seymour J.) Metz" <sp******@library.lspace.org.invalid>
wrote:
I've got a document that StarOffice converted into HTML,
Hmm. I've never examined StarOffice generated code before. But this
doesn't bode well...
and I'm
trying to clean up the cuft that it generated. I put together some
basic styles, and tied using them: the results are puzzling. The style
definition is:

<STYLE>
<!--
@page { size: 8.5in 11in; margin: 0.79in }
div.res dl dt {
font-weight: bold;
line-height: 3;
text-decoration: underline; }
div.res dl dd { font-size: medium; }
div.res ul li { font: "Courier, serif"; }
This means use a font called 'Courier, serif'. I doubt that any sucj
font exists. A more normal definition would be
font-family: Courier, monospace;
as Courier is a monospaced font, not a serif one.
(Typographically speaking monospaced and serif aren't mutually
exclusive but in web terms the monospaced quality is usually more
important.)

Note that if you use the font shorthand you must specify the size as
well as the family.
http://www.w3.org/TR/CSS2/fonts.html#propdef-font

.lead {
font-weight: bold;
line-height: 3;
text-decoration: underline;
text-indent: 0; }
.emp { font-weight: bolder; font-size: 1.2em; }
-->
</STYLE>
The StarOffice-generated HTML made extensive use of font tags, which I
am trying to eliminate.
Bravo.
<div class=res>

<p class="lead">
RECENT EXPERIENCE:
</p>

<p>
<span class="emp">name</span>,
address (dates):
</P>

<UL TYPE=DISC>
<LI>text</li>
<LI><P ><FONT FACE="Courier, serif">text
<LI><P ><FONT FACE="Courier, serif">text</FONT></P>
<LI><P ><FONT FACE="Courier, serif">text</P>
<LI><P ><FONT FACE="Courier, serif">text</FONT></P>
<LI><P ><FONT FACE="Courier, serif">text</FONT></P>
<LI><P ><FONT FACE="Courier, serif">text</FONT></P>
</UL>

Superficially it appear as though the text in the first li element
should be rendered the same as the text in the other li elements, but
it isn't.
Not rendered the same in what respect?
What happens when you correct the CSS syntax as outlined above?
Also, if I try to include either of

font: "Courier, serif";
font-family: "Courier, serif";

in my definition of .emp, then it no longer renders in bold. Please
advise.
Could be a number of things. I'd suggest fixing the syntax errors and
validating your code, then coming back and posting a URL if the
problem's still there.

BTW <span class="emp"> makes me think that the purpose is emphasis? In
that case <em> or <strong> would be more appropriate.
Note, this is not XHTML, so the missing ending tags (</font>, </p>)
should be legitimate.


The end tag for font is not optional in HTML 4.
The end tag for p is optional in HTML 4.
When using CSS it helps to include all optional end tag as it limits
the number of browser bugs that can apply.

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
In <ko********************************@4ax.com>, on 07/09/2004
at 11:53 PM, Steve Pugh <st***@pugh.net> said:
This means use a font called 'Courier, serif'.
Whoops! Thanks; It worked fine when I removed the extraneous quotes.

Note that if you use the font shorthand you must specify the size as
well as the family.
Okay; I changed it to font-family.
Not rendered the same in what respect?
Font and font size.
What happens when you correct the CSS syntax as outlined above?
It works fine, as noted above.
BTW <span class="emp"> makes me think that the purpose is emphasis?
Indirectly; class=emp is for names of employers, and I did specify
emphasis. Which raises a stle question. Which is preferable?:

<p>
<span class="emp">name</span>,
address (dates):
</P>

<p>
<span class="emp">name</span>,
<address>address</address> (dates):
</P>

<p>
<address><span class="emp">name</span>,
address</address> (dates):
</P>
The end tag for font is not optional in HTML 4.
I've been removing the font tags entirely.
The end tag for p is optional in HTML 4.


Understood, but I want to be able to easily move to XHTML when it
becomes a bit better supported.

BTW, I would have responded earlier, but your article isn't in my news
feed; I had to pull it from google. I suspect that it got hit by the
rogue cancels.

Again, thanks for the assistance.

--
Shmuel (Seymour J.) Metz, SysProg and JOAT <http://patriot.net/~shmuel>

Unsolicited bulk E-mail subject to legal action. I reserve the
right to publicly post or ridicule any abusive E-mail. Reply to
domain Patriot dot net user shmuel+news to contact me. Do not
reply to sp******@library.lspace.org

Jul 20 '05 #3
"Shmuel (Seymour J.) Metz" <sp******@library.lspace.org.invalid>
wrote:
Steve Pugh <st***@pugh.net> said:

BTW <span class="emp"> makes me think that the purpose is emphasis?
Indirectly; class=emp is for names of employers, and I did specify
emphasis. Which raises a stle question. Which is preferable?:

<p>
<span class="emp">name</span>,
address (dates):
</P>


This one.
<p>
<span class="emp">name</span>,
<address>address</address> (dates):
</P>

<p>
<address><span class="emp">name</span>,
address</address> (dates):
</P>


<address> is for marking up the contact details of the author of the
document, not for marking up any old address.

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

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

Similar topics

3
by: Shmuel (Seymour J.) Metz | last post by:
I've got a document that StarOffice converted into HTML, and I'm trying to clean up the cuft that it generated. I put together some basic styles, and tied using them: the results are puzzling. The...
7
by: Fabian Neumann | last post by:
Hi! I got a problem with font-family inheritance. Let's say I have CSS definitions like: p { font:normal 10pt Verdana; } strong { font:normal 14pt inherit;
115
by: J | last post by:
I've run CSSCheck on my style sheets and I always get a warning similar to this: "font: bold 9pt/100% sans-serif Warning: Absolute length units should not generally be used on the Web ..." ...
0
by: Paul D. Sullivan | last post by:
I've been trying to find out how to increase the font size in the text entry fields in Invision Power Board 1.3 for a while. The part where you enter your post and do the quick reply and all that...
9
by: Dr John Stockton | last post by:
Assuming default set-ups and considering all reasonable browsers, whatever that may mean, what should an author expect that his readers in general will see (with visual browsers) for a page with...
4
by: JK | last post by:
In my Windows form, I have a discrepancy between what the CrystaReport viewer displays and what the dataset contains. The Report displays data from three fields from same table but the...
4
by: tshad | last post by:
I am having trouble with links in my DataGrid. I have Links all over my page set to smaller and they are consistant all over the page in both Mozilla and IE, except for the DataGrid. Here is a...
7
by: Sakharam Phapale | last post by:
Hi All, How to preserve the old font properties while changing new one? I posted same question 2 months back, but I had very small time then. eg. "Shopping for" is a text in RichTextBox and...
7
by: Daniel Kaplan | last post by:
I have the item below at the top of my style sheet. And it seems that the font-szie is ignored. I know that my linked style sheet is being read, and used because if I remove the font-family line,...
2
by: kheitmann | last post by:
OK, so I have a blog. I downloaded the "theme" from somewhere and have edited a few areas to suit my needs. There are different font themes within the page theme. Long story short, my "Text Posts"...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
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...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...

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.