6 replies [Last post]
dlestarjette
Offline
newbie
Chicago, IL USA
Last seen: 16 years 36 weeks ago
Chicago, IL USA
Timezone: GMT-6
Joined: 2004-01-21
Posts: 6
Points: 0

Hello, I have a couple of questions that I'm hoping you all can help me with.

First, is it possible with CSS to indent the second (and all subsequent) lines of a paragraph, while the first line is not indented (as in a works cited/bibliography)? For example:

Quote:
Darwin, Charles. On the Origin of Species by Means of Natural Selection, or the Preservation of Favoured Races in the Struggle for Life. 1859. New York: Penguin, 1985.

Wildman, Derek E., et al. “Implications of natural selection in shaping 99.4% nonsynonymous DNA identity between humans and chimpanzees: Enlarging genus Homo.” PNAS 10 June 2003: 7181 – 7188. Proceedings of the National Academy of Sciences. 2003. Nat. Acad. Sci. 6 Apr. 2004 <http://www.pnas.org/cgi/doi/10.1073/pnas.1232172100>.

Here, the lines beginning "Darwin, Charles" and "Wildman, Derek E." would not be indented, but any other lines in the paragraphs should be indented.

Second, is it possible to specifiy an "if/then" statement in CSS for fonts? For example, if a page visitor has Font A installed, then the font-size should be 8px, letter-spacing should be 3px. If the visitor does not have Font A, then use Font B with a font-size of 10px, and letter-spacing of 2px. (Does that make sense? I'm not sure if I'm explaining that well or not.)

Thanks for any asssitance!
Daniel

[Edited to add: in the complete title of Charles Darwin's famous work on evolutionary theory, the word "races" refers to what are commonly known as breeds (as in Border Collies or Beagles in dogs), not races in the human context it's generally used today. Just an FYI, because I didn't want to get any hate mail! Laughing out loud ]

dJomp
dJomp's picture
Offline
Enthusiast
Last seen: 4 years 34 weeks ago
Joined: 2003-03-23
Posts: 422
Points: 0

Two textual questions

The first can be done with padding-left and text-indent. Text-indent works on the first line of a paragraph...

	padding-left : 22px;
	text-indent : -22px;

so this will put the body of the text 22px in, and the first line in the normal position.

Second question I'm not so sure about.

You know you're a geek when you try to shoo a fly away from the monitor with your cursor.

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 5 years 37 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

Two textual questions

what about using a dl list,
possibly dl for title, dt for the main text and dd for the publication details with suitable indents on each, although they may well suit with defaults .... just a thought

The second question I would think is a javascript problem I doubt it's possible with CSS and I think it would be hard either way.

Hugo.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

dlestarjette
Offline
newbie
Chicago, IL USA
Last seen: 16 years 36 weeks ago
Chicago, IL USA
Timezone: GMT-6
Joined: 2004-01-21
Posts: 6
Points: 0

Two textual questions

dJomp, thanks...I'll give it a try and see what happens.

Hugo, thanks also...however, I have no clue what dl lists are! Laughing out loud I'm always up for learning something new though, so I will try to find out, and see if it works for me.

As for my second question, I wasn't holding out much hope that it was possible and/or easy to accomplish. Thanks anyway.

Thanks again,
Daniel

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 5 years 37 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

Two textual questions

Apologies,
should have said dl=definition list dt=definition term dd=definition description.

They are a bit like unordered lists.

Here is a reasonable explanation on them (if you havn't found one already!)

http://www.maxdesign.com.au/presentation/definition/

Hugo.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

_janim
Offline
Regular
phinland
Last seen: 16 years 16 weeks ago
phinland
Joined: 2004-06-08
Posts: 22
Points: 0

Two textual questions

To the second question - yes it is possible with a bit of javascript examination, but the job's a bit tricky.
Find out more by reading thru this DHTML Lab article http://www.webreference.com/dhtml/column30/

Please Provide a link to your code/site. If you can't, then please at least provide the HTML & CSS together.

obsidian
Offline
Enthusiast
South Carolina
Last seen: 13 years 49 weeks ago
South Carolina
Joined: 2004-08-15
Posts: 136
Points: 0

Two textual questions

The Javascript example above works, but I think as another newbie, the easiest way I've found to adjust to specific fonts installed is simply to list exact names of fonts in order of preference when you call for your font-family.

Example:

#navbar {
    font-family: 'Trebuchet MS', 'Lucida Grande',
    Verdana, Lucida, Geneva, Helvetica, Arial, sans-serif;
}

With the single-quotes, it allows you to specify your "pecking-order" if you will of the fonts you wish to check for on your user's computer. In this case, we check for Trebuchet MS first, if it's not there, use Lucida Grande, and if, for some reason, they are both absent, make your way through the typical Verdana font family.

Hope this helps!

You can't win, you can't lose, you can't break even. You can't even get out of the game!