Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

blockquote without newline

Status
Not open for further replies.

iluvperl

Programmer
Jan 22, 2006
107
Is it possible to do a blockquote without having a new line BEFORE it? Ie.

Code:
<p>Question 1)
<blockquote>Answer goes here</blockquote>
</p>

Produces 1 entire blank line after the question and before the blockquote answer. If this has to be CSS, can someone give me in-line CSS since this is more or less a dirty page hack the way it is.
 
It looks to me you need to adjust margin-top, but I could be mistaken. Anyway, blockquote is a block level element, so it will begin on a new line -- if that is your problem, removing the margin will not help and you will have to resort to [tt]display: inline;[/tt]. However, if I am reading you correctly, you do not like the extra space between the previous text and beginning of the blockquote. If that is what is bothering you, then margin-top is the right choice. Similarly you can do with the margin-bottom, if that will bother you as well, since (at least in FF) default margins at the top and bottom for blockquote are 1em.
Code:
<p>Question 1)
<blockquote style="margin-top: 0;">Answer goes here</blockquote>
</p>
 
Whatever CSS you apply, that's invalid HTML. A <blockquote> cannot be contained within a <p> element.

Neither seem the appropriate elements for a list of questions and answers, how about a definition list?
Code:
<dl class="quiz">
<dt>Question 1)</dt>
<dd>Answer goes here</dd>
<dt>Question 2)</dt>
<dd>Answer goes here</dd>
</dl>
Then use CSS to style it how you want it.

-- Chris Hunt
Webmaster & Tragedian
Extra Connections Ltd
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top