Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Question about CSS selectors

Reply
Thread Tools

Question about CSS selectors

 
 
Jeanne D
Guest
Posts: n/a
 
      10-15-2005
This is probably really obvious, but I can't find what I'm looking to
do in my DHTML and CSS manual.

I want to have two different selectors specified on one line of type.

The Great Escape .... by JD

I wanted the The Great Escape to be in one font and ... by JD in
another. How do I do that? Thanks much.

 
Reply With Quote
 
 
 
 
Jeanne D
Guest
Posts: n/a
 
      10-15-2005
Please disregard my question - I need to familiarize myself with
positioning. Guess one has to think differently, I'm still in HTML mode.

 
Reply With Quote
 
 
 
 
Chris Beall
Guest
Posts: n/a
 
      10-15-2005
Jeanne D wrote:

> This is probably really obvious, but I can't find what I'm looking to
> do in my DHTML and CSS manual.
>
> I want to have two different selectors specified on one line of type.
>
> The Great Escape .... by JD
>
> I wanted the The Great Escape to be in one font and ... by JD in
> another. How do I do that? Thanks much.
>

Jeanne,

Hmmm. This looks like a citation, so you could use something like:

<cite>The Great Escape <span class="author">.... by JD</span></cite>

Then, in the CSS:

cite {
font-family: whatever1 ;
}
..author {
font-family: whatever2 ;
}

That would apply whatever2 to ANY element of class author. If that's
too general, you could instead say:

cite span.author {
font-family: whatever2 ;
}

Which means "apply this style to any <span> of class author that is the
descendant of (i.e. contained inside) a <cite>".

The exciting details of CSS selectors can be found at
http://www.w3.org/TR/CSS21/selector.html. I recommend ingestion of a
stimulant before reading.

Chris Beall

 
Reply With Quote
 
dorayme
Guest
Posts: n/a
 
      10-16-2005
> From: "Jeanne D" <(E-Mail Removed)>
>
> This is probably really obvious, but I can't find what I'm looking to
> do in my DHTML and CSS manual.
>
> I want to have two different selectors specified on one line of type.
>
> The Great Escape .... by JD
>
> I wanted the The Great Escape to be in one font and ... by JD in
> another. How do I do that? Thanks much.
>


How about something like:

<div class="whatever1">The Great Escape <span class="whatever2">by
JD</span></div>


dorayme

 
Reply With Quote
 
Andy Dingley
Guest
Posts: n/a
 
      10-16-2005
On 15 Oct 2005 15:01:33 -0700, "Jeanne D" <(E-Mail Removed)>
wrote:

>I wanted the The Great Escape to be in one font and ... by JD in
>another. How do I do that?


<span class="title" >The Great Escape</span> by <span
class="author" >JD<span>


Then in the CSS use

..title {
font-family: sans-serif;
font-size: 110%;
}
..author {
font-family: serif;
font-style: oblique;
}

Obviously you can use any CSS settings in these rules that you might
wish.

And you need a better CSS book (try Lie & Bos)
 
Reply With Quote
 
JDS
Guest
Posts: n/a
 
      10-16-2005
On Sat, 15 Oct 2005 16:01:04 -0700, Jeanne D wrote:

> I'm still in HTML mode.


In a general sense, to mentally transition to HTML+CSS instead of, say
HTML plus HTML tables for layout, remember that absolutely no layout clues
go into the HTML. I think the hardest part of *realy* switching from
using HTML tables for layout is not using HTML for layout AT ALL. A
really well structured HTML document that uses CSS for layout should look,
without the CSS applied, like a very plain vanilla HTML page circa 1994.

--
JDS | http://www.velocityreviews.com/forums/(E-Mail Removed)
| http://www.newtnotes.com
DJMBS | http://newtnotes.com/doctor-jeff-master-brainsurgeon/

 
Reply With Quote
 
Jeanne D
Guest
Posts: n/a
 
      10-16-2005
Thanks Chris - worked great. Thanks for the link too - I've visited
that site in the past.

 
Reply With Quote
 
Jeanne D
Guest
Posts: n/a
 
      10-16-2005
from: dorayme
<<How about something like: <div class="whatever1">The Great Escape
<span class="whatever2">by JD</span></div>>>


Thank you - I will try this too.

 
Reply With Quote
 
Jeanne D
Guest
Posts: n/a
 
      10-16-2005
Andy writes:
<And you need a better CSS book (try Lie & Bos) >

Thanks for the information. I picked up the Zen of CSS design at the
library, will try to find Lie & Bos.

 
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
Help With CSS Selectors Nathan Sokalski ASP .Net 5 03-24-2008 11:11 AM
css selectors Jon Slaughter HTML 13 04-21-2007 05:08 PM
css - descendant selectors Nik Coughin HTML 2 01-29-2004 12:12 AM
CSS background competing selectors question Derek Clarkson HTML 3 11-07-2003 12:08 AM
Class and ID Selectors (CSS question) Matt Beckwith HTML 3 07-13-2003 08:39 PM



Advertisments