Kinda embarissing question...but..

M

morc

For some weird reason, the font won't change. Normaly i wouldn't post
something as easy as this but i can't figure it out.

<p class="textsmallbold"></p>
<p style="font-family:ariel;">
<%=data_body%>
</p>


If anyone knows what im doing wrong please post.
thanks again.
-morc
 
D

Daniel Dyer

For some weird reason, the font won't change. Normaly i wouldn't post
something as easy as this but i can't figure it out.

<p class="textsmallbold"></p>
<p style="font-family:ariel;">
<%=data_body%>
</p>


If anyone knows what im doing wrong please post.
thanks again.

This isn't a Java problem, the font name should probably be "Arial".

Dan.
 
M

morc

no, it doesnt matter what i write for the font name. I tried Arial as u
said and it hasn't changed anything. I thought it was misspelled at
first also. Am i coding it wrong?
 
O

Oliver Wong

morc said:
no, it doesnt matter what i write for the font name. I tried Arial as u
said and it hasn't changed anything. I thought it was misspelled at
first also. Am i coding it wrong?

Again, this is not a Java question. It is more like a CSS question, but
since I cannot find any CSS newsgroups, you should probably take it to an
HTML group (of which there are several).

There could be any number of things wrong. A few random ones off the top
of my head:

(1) Your browser doesn't support CSS.
(2) Some HTML/CSS error earlier or later in the page is causing your
browser to choke, and thus misrendering this section.
(3) Whatever <%=data_body%> evaluates to contains its own CSS style
overriding the style you've placed outside.
(4) It IS working, but you have incorrect expectations on what the
output should be.

My advice:

(1) Use the "View source" feature of your browser.
(2) Try validating the HTML and CSS being produced. See
http://validator.w3.org/
(3) Remove JSP from the equation. Try just generating a static page
which the CSS styles that you want.

- Oliver
 
M

morc

this doesnt make sense to me it should work.

However you are right as this doesnt have much to do with java. I
thought it might because its part of a jsp page. And i figured sine it
was just the variable that changed maybe it was a java issue.

thanks
-morc
 
R

Roedy Green

<p style="font-family:ariel;">

font: bold .95em font Arial,Helvetica,sans-serif;

The line above is from one of my style sheets. This sort of thing
belongs in the style sheet, not the markup.

Anyway I see two problems.

You spelled Arial incorrectly

You did not specify alternatives for non-Windows folk.
 
L

Lasse Reichstein Nielsen

morc said:
For some weird reason, the font won't change. Normaly i wouldn't post
something as easy as this but i can't figure it out.

<p class="textsmallbold"></p>
<p style="font-family:ariel;">
<%=data_body%>
</p>

This is server-side code, not what the browser sees. You should check
the source code in the browser to see what is really being rendered,
and find the error there. Then go back and change the code on the
server to generate a page that works.

My guess is that the value of "data_body" starts with another <p> tag
(or some other tag that cannot occour as a child of a paragraph),
which ends the previous paragraph and its font setting.

/L
 
R

Roedy Green

<p class="textsmallbold"></p>
<p style="font-family:ariel;">
<%=data_body%>

if you meant this code literally it makes no sense. Try it out in
regular HTML first then try generating it in JSP.

<p class="x">zzz</p>
applies the class only to zzz. In your first case zzz is empty. In
your second, the end </p> marker is missing.
and who knows what's inside data_body that could confuse things.


The practical solution is not to use styles in your markup.

Get them into the CSS file and working in ordinary HTML before you
worry about generating markup.

Again stop looking at the JSP and look at the generated code. Figure
out first what you want to generate THEN once you have that working
perfectly and validated, fiddle with getting JSP to generate it. You
shoud be fooling around with a text editor and a browser at this
stage, then later deal with Java.
 
N

Noodles Jefferson

morc said:
For some weird reason, the font won't change. Normaly i wouldn't post
something as easy as this but i can't figure it out.

<p class="textsmallbold"></p>
<p style="font-family:ariel;">
<%=data_body%>
</p>


If anyone knows what im doing wrong please post.
thanks again.
-morc

font-family:arial

--
Noodles Jefferson
mhm31x9 Smeeter#29 WSD#30
sTaRShInE_mOOnBeAm aT HoTmAil dOt CoM

NP: "Icicle" (Tour Rehearsal) -- Tori Amos

"Our earth is degenerate in these latter days, bribery and corruption
are common, children no longer obey their parents and the end of the
world is evidently approaching."
--Assyrian clay tablet 2800 B.C.
 
N

Noodles Jefferson

Oliver Wong took the said:
Again, this is not a Java question. It is more like a CSS question, but
since I cannot find any CSS newsgroups, you should probably take it to an
HTML group (of which there are several).

comp.infosystems.www.authoring.stylesheets


--
Noodles Jefferson
mhm31x9 Smeeter#29 WSD#30
sTaRShInE_mOOnBeAm aT HoTmAil dOt CoM

NP: "Icicle" (Tour Rehearsal) -- Tori Amos

"Our earth is degenerate in these latter days, bribery and corruption
are common, children no longer obey their parents and the end of the
world is evidently approaching."
--Assyrian clay tablet 2800 B.C.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top