HighDots Forums  

Re: CSS: basic indentation question

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss Re: CSS: basic indentation question in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Jukka K. Korpela
 
Posts: n/a

Default Re: CSS: basic indentation question - 08-28-2004 , 04:25 PM






nzanella (AT) cs (DOT) mun.ca (Neil Zanella) wrote:

Quote:
I would like to achieve the following
effect for an FAQ page without having
to resort to html tables. What is the
best way to do it using CSS (note how
the indentation is table-like)?
If you are asking about CSS, the right group is c.i.w.a.stylesheets.
Followups set accordingly.

Quote:
The J'uring Test FAQ
====================

Q: Is my name Joe Doe or is my
name John Doe?

A: How would I know? I tried searching
with Google and found several matches
but still cannot tell. So hey, you
could be Joe, John, someone else,
or you may not even be human.
I assume that this is to be understood so that the text lines proper
(excluding "Q:" and "A:") start at the same position. This is _not_
completely evident from your description, since it becomes apparent (?)
only when your message is viewed using a monospace font.

This sounds tricky, and I'm afraid you'll at least need extra markup to
make "Q:" and "A:" elements that can be styled, in addition to the
obvious (?) markup

<h2> Q: Is my name Joe Doe or is my
name John Doe?</h2>
<p>
A: How would I know? I tried searching
with Google and found several matches
but still cannot tell. So hey, you
could be Joe, John, someone else,
or you may not even be human.
</p>

Using <span>Q:</span> and <span>A:</span>, one approach might be

span { position: absolute;
left: -1.5em; }
h2, p { position: relative;
margin-left: 1.5em; }
h2 { font-size: 100%; }

(though you probably want to use classes for <span> and maybe <p>, or for
some containers of them, since you might have other <span> and <p>
elements on the page as well).

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html



Reply With Quote
Reply




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.