473,387 Members | 1,541 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

how to not insert a new line after <dt> in a <dl> ?

I think browsers do it pretty much by default. How can you avoid that?

It just doesn't look right/pretty for short definitions and also how
can you not indent the whole <dd> so that in stead of looking like
this:

<code>
_ _ _ term: def def def def def def ...
_ _ _ _ _ _ def def def def def def ...
</code>

it would look like:

<code>
_ _ _ term: def def def def def def ...
_ def def def def def def def def def ...
</code>

That is it would not indent the whole def to the right passed the term

Thanks
otf

Jan 29 '06 #1
13 6776
Els
onetitfemme wrote:

[subjectline: How to not insert a new line after <dt> in a <dl>?]
I think browsers do it pretty much by default. How can you avoid that?
In your stylesheet:
dt{float:left;clear:left;}
It just doesn't look right/pretty for short definitions and also how
can you not indent the whole <dd> so that in stead of looking like
this:

<code>
_ _ _ term: def def def def def def ...
_ _ _ _ _ _ def def def def def def ...
</code>

it would look like:

<code>
_ _ _ term: def def def def def def ...
_ def def def def def def def def def ...
</code>

That is it would not indent the whole def to the right passed the term
In your stylesheet:
dd{margin-left:0;}
Thanks


You're welcome :-)

--
Els http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -
Jan 29 '06 #2
onetitfemme wrote:
I think browsers do it pretty much by default.
Browsers do "it" pretty much by default? One of the oddest statements
about doing "it" I've seen. If you didn't mean "it", you should have
specified what you mean. (Note: it is bad practice to refer to a heading
in the copy text of a message, article, web page, or anything.)
How can you avoid that?
If "that" means means "a new line after <dt>", then there's nothing to
be avoided. There is no new line. Just some margin or padding, which may
look like a line to an untrained eye, especially if you don't pay
attention to the fact that there is no spoo... I mean line. Can you have
a line of text without any text?

If you mean the vertical spacing, i.e. the vertical margin or padding,
then surely you know how to work with them in CSS. What exactly did you
try? URL?

On the other hand, which browser uses a default bottom margin or padding
for <dt>? You seem to be asking for help with a vaguely described
problem that does not exist.

Or did you mean you don't want even a line break after <dt>, i.e. you'd
like to have the definition start at the same line? That would be odd,
and your sketchy example does not support this idea.

The simple answer is "don't use <dl>", and it's mostly correct, since
mostly people have not got a list of _definitions_ (i.e., _terms_ with
their _definitions_) when they use <dl>.
It just doesn't look right/pretty for short definitions and also how
can you not indent the whole <dd> so that in stead of looking like
this:

<code>
_ _ _ term: def def def def def def ...
_ _ _ _ _ _ def def def def def def ...
</code>
Well, it has no new line. What _is_ the problem? And what's that <code>
stuff there?
it would look like:

<code>
_ _ _ term: def def def def def def ...
_ def def def def def def def def def ...
</code>

That is it would not indent the whole def to the right passed the term


This is far too vague. Why don't you post a URL and specify exactly what
you would like to change in the default appearance (on some browsers)?

Besides, the <dl> element is so widely abused for mixed name/value pairs
that contain no definitions whatsoever that it's not particularly useful
semantically. If you add the observed fact that its default renderings
have idiosyncracies and are difficult to tune with CSS, the question
arises why you use it.

Using just e.g.

<p><dfn>Term:</dfn> def def def...</p>

might be a better starting point. You would not have much unexpected and
unpredictable default rendering, and you could play with margin-left and
text-indent for the paragraphs. Of course you could also use a <ul>
instead of a sequence of <p> elements, but if the definitions are long,
simple paragraphs might be more natural.
Jan 29 '06 #3
On Sun, 29 Jan 2006 14:09:36 +0100, onetitfemme
<on*************@yahoo.com> wrote:
It just doesn't look right/pretty for short definitions and also how
can you not indent the whole <dd> so that in stead of looking like
this:

<code>
_ _ _ term: def def def def def def ...
_ _ _ _ _ _ def def def def def def ...
</code>

it would look like:

<code>
_ _ _ term: def def def def def def ...
_ def def def def def def def def def ...
</code>


I set up an example (only tested it in Opera) at
<URL:http://www.pretletters.net/_test/styling_definition_lists.html>. That
could help you.


--
______PretLetters:
| weblog | http://www.pretletters.net/_private/weblog.html |
| webontwerp | http://www.pretletters.net/html/webontwerp.html |
|zweefvliegen | http://www.pretletters.net/html/vliegen.html |
Jan 29 '06 #4
On Sun, 29 Jan 2006, Jukka K. Korpela wrote:
Besides, the <dl> element is so widely abused for mixed name/value
pairs that contain no definitions whatsoever that it's not
particularly useful semantically.


I think we agree on the observations; but I'm not sure that everyone
has to draw the same conclusion from it. The HTML/4.01 specification
already suggests a plausible application of the markup which quite
obviously is not a "definition":

||Another application of DL, for example, is for marking up dialogues,
||with each DT naming a speaker, and each DD containing his or her
||words.

which would fail the strict semantic test.

Given that many of the uses of <dl> that are observed "in the field"
(excluding those which are obviously so far adrift as to be bogus)
can be interpreted constructively as groups of "term and values", even
if they are beyond the borderline as regards your personal standards
of "definition", I think it's possible to accept a rather wider
interpretation of this markup for practical purposes.

You may parse that as me saying "since so many others are abusing it,
then I may as well abuse it myself", but I'd prefer to apply a more
positive and constructive interpretation than that.

I'm not saying the HTML/4.01 spec is always right - indeed I know that
in some places it effectively contradicts itself - but in this case I
think its acceptance of a wider semantic for <dl> isn't so bad as your
consistently expressed views about it.

IMHO and YMMV, of course.
Jan 29 '06 #5
C'mon Jukka, I think you understood me just fine

I think I will be going for your suggestion (as coocked by me ;-))
looking more like:

<code>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"
dir="ltr">

<head>
<title>list test</title>
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<style type="text/css">

div.float {
float: left;
margin-left: 10px;
margin-right: 10px;
}

div.float p { text-align: center; }

span.trm {
text-indent: 0.50em;
font-weight: bold;
}

ul li p.def {
text-indent: 0.00em;
margin-top: 0px;
margin-down: 0px;
}

p{
text-indent: 1.50em;
margin-top: 0px;
margin-down: 0px;
}

</style>
</head>

<body>

<span style="horizontal-align: center;">
<div> <!-- float container -->
<div class="float">
<img src="image1.gif" width="100" height="100" alt="image 1" /><br />
<p>caption 1</p>
</div>

<div class="float">
<img src="image2.gif" width="100" height="100" alt="image 2" /><br />
<p>caption 2</p>
</div>

<div class="float">
<img src="image3.gif" width="100" height="100" alt="image 3" /><br />
<p>caption 3</p>
</div>

<!-- clearing floating container -->
<div style="clear: both;"></div>
</div>
</span>

<hr />

<ul>
<li><p class="def"><span class="trm">Term 1</span>: def1 ...</p></li>
<li><p class="def"><span class="trm">Term 2</span>: def2 ...</p></li>
<li><p class="def"><span class="trm">Term 3</span>: def3 ...</p></li>
</ul>

<p>This is a freely standing paragraph</p>

<html>
</code>

I still wasn't able to center the three images on the top even if
floating to the left

I you go "div.float { float: center; }" you would destroy the
floating
(Note: it is bad practice to refer to a heading in the copy text of a message, article, web page, or anything.)

However, my postwas very short; anyone could get what I meant with
"it" ;-)

Thanks
otf

Jan 29 '06 #6
"onetitfemme" <on*************@yahoo.com> wrote:
C'mon Jukka, I think you understood me just fine
No I didn't, and I refuse to be on a first-name basis with an anonymous
poster.
I think I will be going for your suggestion (as coocked by me ;-))


You misspelled "misunderstood". Your tag sallad does not tell what you are
trying to accomplish, and since you refuse to post the URL, you refuse to be
helped. HAND.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Jan 29 '06 #7
onetitfemme wrote :
I think browsers do it pretty much by default. How can you avoid that?

If a wide majority of browsers do "it" by default, then is it in your
best interests as a web author to modify "it", to code against "it"?
That is assuming of course that you are using <dt> and <dl> accordingly
to begin with.
It just doesn't look right/pretty for short definitions
Is a short definition still implying a definition term and definition
data? If so, then what's wrong with applying the best semantic markup to
a page situation? Looking right/pretty does not apply and should not
apply; best semantic markup should apply.
and also how can you not indent the whole <dd> so that in stead of looking like
this:

<code>
_ _ _ term: def def def def def def ...
_ _ _ _ _ _ def def def def def def ...
</code>

it would look like:

<code>
_ _ _ term: def def def def def def ...
_ def def def def def def def def def ...
</code>


dt { display: compact; }
dd { margin-left: 0; }

Gérard
--
remove blah to email me
Jan 29 '06 #8
Gérard Talbot wrote :
dt { display: compact; }
dd { margin-left: 0; }


Even better:

dt {font-weight: bolder; display: run-in;}
dd {margin-bottom: 0;}

http://www.w3.org/TR/CSS21/visuren.html#run-in

Gérard
--
remove blah to email me
Jan 29 '06 #9
On Sun, 29 Jan 2006 23:01:08 +0100, Gérard Talbot
<ne***********@gtalbot.org> wrote:
<code>
_ _ _ term: def def def def def def ...
_ def def def def def def def def def ...
</code>

dt { display: compact; }
dd { margin-left: 0; }


Doesn't seem to do anything. At least it doesn't create a definition list
looking like the 'ascii art' example provided by OP. I tried and added
these styles to my example page. Go see
<URL:http://www.pretletters.net/_test/styling_definition_lists.html>.
You're the third example in that page.

Gérard
--
remove blah to email me


Your sig sep is broken. And before you start telling me that mine is too,
it has something to de with Thunderbird 1.5 you use. It is buggy somehow
with signature blocks. Don't ask me why/how, 'cause I don't know any more.

--
______PretLetters:
| weblog | http://www.pretletters.net/_private/weblog.html |
| webontwerp | http://www.pretletters.net/html/webontwerp.html |
|zweefvliegen | http://www.pretletters.net/html/vliegen.html |
Jan 29 '06 #10
On Sun, 29 Jan 2006 23:25:09 +0100, Gérard Talbot
<ne***********@gtalbot.org> wrote:
Gérard Talbot wrote :
dt { display: compact; }
dd { margin-left: 0; }


Even better:

dt {font-weight: bolder; display: run-in;}
dd {margin-bottom: 0;}

http://www.w3.org/TR/CSS21/visuren.html#run-in


Which does indeed work in Opera, but doesn't in Internet Exlorer (if you
care about that), but also doesn't seem to work in Firefox1.5 (which is a
bit more worrying).

Again:
<URL:http://www.pretletters.net/_test/styling_definition_lists.html>, this
time the fourth example.
--
______PretLetters:
| weblog | http://www.pretletters.net/_private/weblog.html |
| webontwerp | http://www.pretletters.net/html/webontwerp.html |
|zweefvliegen | http://www.pretletters.net/html/vliegen.html |
Jan 29 '06 #11
I think Yucca's proposal is best and it will be the one I will be
using. Browsers out there are very "free" indeed interpreting something
as simple as a the layout of a list (which IMHO shouldn't be much of a
deal).

From the browsers I have access to right now:
._ Gecko/20050911 Firefox/1.0.6 does NOT
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.10) Gecko/20050911
Firefox/1.0.6 (Debian package 1.0.6-5)
..
._ Konqueror 3.4.1 (Using KDE 3.4.1) takes is just find
._ Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8) Gecko/20051111
Firefox/1.5 takes it OK also
..
I still had a question on how to center, as a group, say, three
pictures that have been laid out floating to the left each. Here is a
link to a demo page:
..
http://www.geocities.com/tekmonk2005...st_test00.html
..
Also Yucca, bro, take it easy. Here, in public on line fora, people's
names are "mingo", "snow_white", "onetitfemme" or whatever they feel
like going by. I don't think that it really matters. Thing is that the
immediacy that the Internet gives us is good, I think. I wouldn't know
of any other way to treat you than your screen name and I sincerely
wondered what your qualms where about.
..
otf

Jan 30 '06 #12
onetitfemme wrote:
.
I still had a question on how to center, as a group, say, three
pictures that have been laid out floating to the left each.
.

Then why did you float them left?
You could put the images in a div, make the div just wide enough for the
images, and center the div. No floating involved.

--
jmm (hyphen) list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
Jan 31 '06 #13
You misspelled "salad."

Yucky, http://www.yuckycorpulent.com

Jan 31 '06 #14

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Peter Crom | last post by:
Hi everyone, I have lists, encoded as <dl compact>...</dl> which runs perfectly under IE 6.0 (for the time being) but not in NN 7.0, as it was obedient enough to the standards that call this...
6
by: The Plankmeister | last post by:
Hi.. I'm trying to achieve a newline effect within a <dt> block, but am having problems. Here is the basic code: <dl> <dt> <a href="admin_menu.html" class="small">Click here to modify the
4
by: Andre Majorel | last post by:
I'm trying to make a compact <dl> class à la troff .TP where you have Term Definition of the term. Longer Term Definition of the longer term. i.e. if the <dt> text is shorter than the...
25
by: Shannon Jacobs | last post by:
Maybe there is a simple trick here, and I'm not spotting it... Is there a guru of CSS hanging around here who can help out? The page in question has a multi-column table with a list of links in...
16
by: Ian Rastall | last post by:
I'm doing a very simple RSS 2.0 feed by hand <http://www.bookstacks.org/rss.xml> and changing the sole <item></item> section for each day. Is this the general way in which RSS feeds are done? I'm...
3
by: Andy Dingley | last post by:
Imagine the XHTML "definition list" structure <dl> <dt>A</dt> <dd>a</dd> <dt>B</dt> <dd>b1</dd> <dd>b2</dd>
9
by: David Trimboli | last post by:
In designing some of my pages (see http://www.trimboli.name/rune/goblinmagic.html for an example), I created a lot of markup to mimic the book upon which the pages are based. My thinking at the...
5
nathj
by: nathj | last post by:
Hi All, I'm working on a new site that has a two column layout underneath a title bar. If you check out: http://www.christianleadership.org.uk/scratch/mainpage.php using IE or Opera you will...
3
by: ddailey | last post by:
The code which follows is something I cobbled together quite hastily to display to students a way of illustrating HTML source code (including CSS and JavaScript) alongside a page as rendered. I've...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.