473,799 Members | 3,858 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 6846
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;c lear: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_definit ion_lists.html> . That
could help you.


--
______PretLette rs:
| 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="horizont al-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"><sp an class="trm">Ter m 1</span>: def1 ...</p></li>
<li><p class="def"><sp an class="trm">Ter m 2</span>: def2 ...</p></li>
<li><p class="def"><sp an class="trm">Ter m 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
"onetitfemm e" <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_definit ion_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.

--
______PretLette rs:
| 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

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

Similar topics

2
1670
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 feature 'deprecated'. It is suggested to solve the problem with css But how?
6
3906
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
7844
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 margin-left, the <dd> is on the same line. Otherwise, the <dd> goes on the next line.
25
5030
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 each column. Because links are added and deleted separately in each column, it would be exceedingly awkward to use a separate table row for each link. Therefore, within each column the links are separated by <br> tags. However, the automatic line...
16
1624
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 intentionally trying to avoid using software to generate / manage the feed. Ian -- http://sundry.ws/
3
3592
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
1998
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 time was that even if one turned off styles one should see the words "Narration," "Background," or "Closer Inspection" in a boldface font, or at least as distinct from the rest of the paragraph. "It's an indication of what sort of paragraph it is,"...
5
5267
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 see what I am after as these browsers work fine. However, in FF the results are slightly different - take a look and you'll see that the <p>, within <div class="mainContent"> has shot way over to the right. I've been working on this for 2days now...
3
2659
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 done this a dozen different ways for slightly different purposes and rather can't remember what the various outcomes of my inquiries have been. In the following I use <xmpas a way of displaying source code. It works in IE, Opera, and FF, but I...
0
9687
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9543
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10488
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10237
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9077
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5467
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5588
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4144
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3761
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.