4 replies [Last post]
larmyia
Offline
Elder
London
Last seen: 12 years 11 weeks ago
London
Timezone: GMT+1
Joined: 2005-01-25
Posts: 1060
Points: 0

Hi, how do I <id> a word/phrase in the middle of a <p>, so that I can apply CSS to it?

ie the html might be:

<p>css is very complicated</p>

and I want VERY in bold.

I know this is not a great example, but I hope you're able to understand my query.

many thanks

larmyia

karinne
karinne's picture
Offline
Enthusiast
Aylmer, QC, Canada
Last seen: 13 years 23 weeks ago
Aylmer, QC, Canada
Timezone: GMT-5
Joined: 2004-01-14
Posts: 291
Points: 0

&lt;id&gt; question

just use the <strong>....</strong> for bold... that still a very valid tag

but... if you want to say, change the color or something like that Wink then use a span ... ie

This is <span class="green">green</span>.

and the css would be

.green {
  color: #009;
}

hth

larmyia
Offline
Elder
London
Last seen: 12 years 11 weeks ago
London
Timezone: GMT+1
Joined: 2005-01-25
Posts: 1060
Points: 0

&lt;id&gt; question

Laughing out loud

thanks so much! that's EXACTLY what I need. you're a star!

larmyia

larmyia
Offline
Elder
London
Last seen: 12 years 11 weeks ago
London
Timezone: GMT+1
Joined: 2005-01-25
Posts: 1060
Points: 0

&lt;id&gt; question

I've just been trying it and I'm not sure...maybe I asked the wrong thing...

I have two sentences that I want on the same line, one aligned to the right, one to the left. the <span> thing doesn't appear to be working. should I just put several "&nbsp;" in between the two lines?

Sad

gary.turner
gary.turner's picture
Offline
Moderator
Dallas
Last seen: 3 hours 59 min ago
Dallas
Timezone: GMT-6
Joined: 2004-06-25
Posts: 9774
Points: 3856

&lt;id&gt; question

larmyia wrote:
I've just been trying it and I'm not sure...maybe I asked the wrong thing...

I have two sentences that I want on the same line, one aligned to the right, one to the left. the <span> thing doesn't appear to be working. should I just put several "&nbsp;" in between the two lines?

SadThat's a different question than the one that started the thread. You really should have begun a new topic.

<p><span style="float: right;">This is to the right</span>and this is to the left</p>

<p style="text-align: right;"><span style="float: left;">This is to the left</span>and this is to the right</p>
and a whole bunch of other variations on a theme.

cheers,

gary

If your web page is as clever as you can make it, it's probably too clever for you to debug or maintain.