I know HTML, I know CSS - So why can't I select some text and apply a style to it?

M

Murray

Or, you could just use span tags -

span.thisone { color: #FFC0CB; font-size:1em; }
span.thatone { color: #FFC0CB; font-size:1em;font-weight:bold;
font-style:italic; }

and then you could have -

<p><span class="thisone">You will see normal text here </span><span
class="thatone">and bold, italic text here.</span></p>

--
Murray

Kathleen Anderson said:
Paul:
Your ordinary text would look like this: <p>Hello World</p>

To apply a style to it, you would add this to your stylesheet:

p {
color: #FFC0CB;
font-size: 12pt;
}


p.other {
color: #FFC0CB;
font-size: 12pt;
font-weight: bold;
font-style: italic;
}

The choose .other from the dropdown to format the one you want italic and
bold.

--

~ Kathleen Anderson
Microsoft FrontPage MVP
Spider Web Woman Designs
http://www.spiderwebwoman.com/resources/



Paul H said:
Aha, I think I am learning some basics here...

The text in question is "not" a hyperlink it's just ordinary text. So
my next question is...

How "should" I be formatting my text? What should the code look like?

If
<a class="10pt_bold_pink">Hello World</a>
is wrong

What should the code look like to achieve the following.

I want this text 12pt. I want this text 12pt bold italic. I want this
text 12pt again.

Last question promise :O)

Thanks again

Paul

Kathleen Anderson said:
Paul:
Before you try and apply a style to an anchor, which is what the <a>
tag represents, you need to properly format the tag; like this:

<p><a href="http://www.w3.org/TR/html401/"> HTML 4.01
Specification</a></p>

Your anchor has no href.

--

~ Kathleen Anderson
Microsoft FrontPage MVP
Spider Web Woman Designs
http://www.spiderwebwoman.com/resources/



What I am trying to achieve is to turn "only" the bold text into
bold/italic...

Here's my code:

<body>
<a class="body_bold">Hello World - in bold</a>
<br><br>
<a class="body_italic">Hello World - in italic</a>
</body>

In normal mode I click on the opening <a> tag for the "Hello World -
in bold" line which selects the text and the tags for the first line
only. From the pull down style menu I select "body_bold_italic".

Here is the resulting code:

<p class="body_bold_italic">
<a class="body_bold">Hello World - in bold</a>
<br><br>
<a class="body_italic">Hello World - in italic</a> </p>
</body>

Why has the whole lot been wrapped in a <p> tag? I only selected the
first line!

The code I was expecting to see was:

<body>
<a class="body_bold_italic">Hello World - in bold</a>
<br><br>
<a class="body_italic">Hello World - in italic</a>
</body>

What am I missing?

Thanks Kathleen,

Paul



"Kathleen Anderson [MVP - FrontPage]" <[email protected]>
wrote in message <a> is not a style, it's an HTML tag. You have to add the <a> tag
in the HTML first, then select your <a> tag style from the
dropdown.

--

~ Kathleen Anderson
Microsoft FrontPage MVP
Spider Web Woman Designs
http://www.spiderwebwoman.com/resources/



Thanks Kathleen!!

If I highlight a piece of text and then select a style from the
style dropdown, the code that is inserted is:
<p class="body_bold">
But I want
<a class="body_bold">
Because I don't want the entire page wrapped in a <p> tag. I just
want the text I have selected wrapped in an <a> tag.

What am I doing wrong?

Regards,

Paul



I believe Ravi is referring to the style dropdown as shown in the
attached image.

--

~ Kathleen Anderson
Microsoft FrontPage MVP
Spider Web Woman Designs
http://www.spiderwebwoman.com/resources/



Here's the tag selector (see snap). But I can see no Class
dropdown in the properties panel. I would be very interested in
knowing this answer myself.


Thanks Ravi, but I can't find the menu options you mention. If
I select "View" I can see "Reveal Tags" but no "Quick tag
selector". Also I have three modes "normal", "HTML" and
"Preview", no "design" mode.

So when you mention "In the design mode on the top.. " I have
no idea where
you mean.

I am very grateful for your help, but I am no closer to solving
this. Please
could you re-word your explanation if it's not too much
trouble.

Many thanks,

Regards,

Paul


message Open FrontPage From the menu View --> Quick Tag selector.
In the design mode on the top you will find the tags specific
to the text selected. Click on the tag and on the down arrow.
Then select Tag Properties. In the Window if you find class
drop down box, select the required class to apply to the
selected text. or right click on the text select the
properties.

There are some HTML tags which do not support all the
properties for example the Class property. You can check at
http://www.w3.org for the tags
and properties supported

Hope this Information helps.

Regards
Ravi
MSFT

This posting is provided "as is" with no warranties and
confers no rights
 
P

Paul H

The penny has dropped!!

Manny thanks, Kathleen, Murray, Ronx and Ravi. I am now wiser although
somewhat more stressed at the thought of changing all the code of this 60+
page website..

gulp!
 
R

Ronx

In HTML view:
<p class="text_12pt">I want this text 12pt. <span
class="text_12pt_bold_italic">I want this text 12pt bold italic.</span> I
want this text 12pt again.</p>

In an earlier post Murray suggested the use of measurements other than pt.
I agree with that, but for the example above stick to pixels - using
relative sizes (percents, em, ex etc.) will give interesting results, until
you get the hang of inheritance.
 

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