Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > CSS Selected Contents

Reply
Thread Tools

CSS Selected Contents

 
 
freesoft_2000
Guest
Posts: n/a
 
      09-22-2006
Hi everyone,

I have this rather silly question which i am not able to do
via CSS.

When i use the font tags i am able to apply the font to a
selected content say in a particular paragraph, but i don't seem to be
able to do this in CSS. Am i missing something.

A simple example of how to apply any font to selected
content in a paragraph using CSS would really be helpful.

Any help is greatly appreciated

Thank You

Yours Sincerely

Richard West

 
Reply With Quote
 
 
 
 
Jonathan N. Little
Guest
Posts: n/a
 
      09-22-2006
freesoft_2000 wrote:
> Hi everyone,
>
> I have this rather silly question which i am not able to do
> via CSS.
>
> When i use the font tags i am able to apply the font to a
> selected content say in a particular paragraph, but i don't seem to be
> able to do this in CSS. Am i missing something.
>
> A simple example of how to apply any font to selected
> content in a paragraph using CSS would really be helpful.
>
> Any help is greatly appreciated
>


http://htmldog.com/guides/cssbeginner/
CSS Beginner's Guide - HTML Dog

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
 
Reply With Quote
 
 
 
 
richard
Guest
Posts: n/a
 
      09-22-2006

"freesoft_2000" <> wrote in message
news: lkaboutprogramming.com...
> Hi everyone,
>
> I have this rather silly question which i am not able to do
> via CSS.
>
> When i use the font tags i am able to apply the font to a
> selected content say in a particular paragraph, but i don't seem to be
> able to do this in CSS. Am i missing something.
>
> A simple example of how to apply any font to selected
> content in a paragraph using CSS would really be helpful.
>
> Any help is greatly appreciated
>
> Thank You
>
> Yours Sincerely
>
> Richard West
>


You might want to use <span>.

<div class="atext">hello this is just a sample <span class="btext"> of what
you can do with css</span> blah blah blah blah blah</div>

Defining fonts and colors for each class as desired.
But research is always good. Even if you think you know it all.






 
Reply With Quote
 
freesoft_2000
Guest
Posts: n/a
 
      09-22-2006
Hi everyone,

Jonathan, your example in the link makes the entire
paragraph have the entire font whereas i only want part of the paragraph
to have that font and the rest of the paragraph not to have any font at
all.

Have i misunserstood your explanation in the link
somehow?

Any help is greatly appreciated

Thank You

Yours Sincerely

Richard West

 
Reply With Quote
 
Beauregard T. Shagnasty
Guest
Posts: n/a
 
      09-22-2006
freesoft_2000 wrote:

> Jonathan, your example in the link makes the entire paragraph have the
> entire font whereas i only want part of the paragraph to have that
> font and the rest of the paragraph not to have any font at all.


"Selected content in a particular paragraph" is a bit vague if you meant
only a couple of words within a paragraph. It could have meant one
paragraph of many.

CSS:
..oddfont {
font-family: Georgia, serif;
}

HTML:
<p>Here is a long paragraph with only
<span class="oddfont">these words</span>
shown in the odd font.</p>

--
-bts
-Motorcycles defy gravity; cars just suck.
 
Reply With Quote
 
Jonathan N. Little
Guest
Posts: n/a
 
      09-22-2006
freesoft_2000 wrote:
> Hi everyone,
>
> Jonathan, your example in the link makes the entire
> paragraph have the entire font whereas i only want part of the paragraph
> to have that font and the rest of the paragraph not to have any font at
> all.
>
> Have i misunserstood your explanation in the link
> somehow?
>
> Any help is greatly appreciated
>


I guess you do not go through the whole tutorial. You can style
individual ELEMENTs so all you have to enclose the text your want to
style differently and enclose in an inline ELEMENT. Now how and which
element depends on the semantic "function' of the text. If you just want
to emphasize text well EM would work.

<p>Are your <em>sure</em> you want to emphasize this?</p>

Now browser normally style EM as italic, but you can change this within
your stylesheet

EM { font-style: normal; color: red; background-color: white; }

This would make every instance in your document where your surround text
with EM tags as red text instead if italic. If you do not wish to change
all the EMs your can specify a class:

..classy { font-family: "bernardfashion bt", fantasy; }

<p>Now my <em class="classy">emphasize</em> will be extra fancy!</p>

If it just a special word or phrase that you want to single out whell
your can us a SPAN element with a class:

..partnumber {
font-family: courier, "courier new", monospace;
font-weight: bold; color: blue; background-color: white;
}


<p>The Widgetmaster 5000 <span class="partnumber">PN: 2344-4322</span>
is a marvel of engineering....</p>



--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding contents on yaml file without overwriting actual contents Kamarulnizam Rahim Ruby 4 01-28-2011 09:10 AM
if innerHTML used twice then it replaces the contents i want it to display all the contents virendra.amritkar@gmail.com Javascript 0 06-29-2007 08:13 AM
Saving entire contents of selected directory? Dave Garrett Firefox 1 08-22-2005 05:26 PM
Can I restrict both attribute contents and element contents in schema Don Adams XML 1 03-05-2004 12:48 PM
Speak the contents of the selected JList item(s) danielliuhh@hotmail.com Java 3 01-07-2004 09:24 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57