How to insert Class CSS onto text

M

Mary

How do I insert a class CSS onto various groupings of text? The only
way I can get it to work is to insert it into the code, but can't
FrontPae let me insert it? The text pieces are various headings to
highlight the content of the text. The text is not in a table or
cell. So far, I highlight the text and go to Format --> Style, I
enter the class, then select it and click ok. The class is created on
the page, but the class is never applied to anything I select.

For example, I created a class called "purpletext" on this page
http://healthyresult.org/p_calcium1.htm and applied it to the large
heading "Immunotec with Pure Milk Calcium". After applying it, the
text remains black.

Also, do classes have to be re-created on each page? I created a
class on another page and it doesn't show up when I switch to a
different page in the same web. I thought the purpose of a class was
that it could apply to different elements on different pages of the
site?
 
S

Steve Easton

The class you created is named purpletest not purpletext.

For what you are trying to do, simply highlight the text and then right
click, select Font and select the font color.

For a css class to work the class name has to be assigned the html element
you are applying it to.

For a class to work on more than one page, it needs to be created in an
external style sheet which is applied across the web. Then the class needs
to be assigned to every element you want it to work in, using
class="classname" without the leading period.
The leading period is only used to identify the class name in a style sheet
or style script.


--
Steve Easton
Microsoft MVP FrontPage
95isalive
This site is best viewed............
........................with a computer
 
M

MD Websunlimited

Hi Mary,

In FP select the text that you wish to apply the CSS Style to, switch to Code/HTML view, enclose the text you wish to apply a CSS
style to with:
<span class="selectorName">The selected text</span> where "selectorName" is the name of the CSS selector

Using FP Format Style you can then select the selector name and apply any styles you wish.

--
Mike -- FrontPage MVP '97-'02
http://www.websunlimited.com
Stop Spam Email Mining from your web pages with SpamStopper
http://www.websunlimited.com/order/product/SpamStopper/spam_stopper_help_dir.htm
FrontPage Add-ins Since '97 2003 / 2002 / 2000 Compatible
 
M

Mary

Hi Mike,
Is there any way to apply the class without entering code view?
Shouldn't FP be able insert the class inside the <p> tag where it is
applied without entering it by hand? Technically, I was told to avoid
the <span> tags as much as possible.
Mary
 
M

MD Websunlimited

You can create the class in the <p> tag but then you have a paragraph. There is nothing wrong with using span tags.
 
S

segott

The first thing I would do is create the external CSS
stylesheet and place all the different styles you want and
name them with clarity e.g., (h1.large
{color:purple;font-size:15pt;} (header tag that's purple
and 15 points in size) and name the CSS (mysite.css) Then,
in FP, go to the HTML view, and in the <head> </head>
section, create the following line:
<link rel="stylesheet" href="mysite.css" type="text/css" />
Note: the path for href="mysite.css" must be correct. Then
in the <body> section, where you want the particular style
to show up, you would call the particular class. In the
about example for <h1>, it would be:
 

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

Top