473,395 Members | 1,452 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,395 software developers and data experts.

newline probs within <dt>

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
'Home' menu section</a>
<a href="index.html">Home</a>
</dt>
<dd><a href="index.html">Me!</a></dd>
<dd><a href="index.html">Oz &amp; N.Z.</a></dd>
<dd><a href="index.html">Stuff</a></dd>
</dl>
And here are the two ways I've tried to place a newline between the <a>'s in
the <dt>:

<a href="admin_menu.html" class="small">Click here to modify the 'Home'
menu section</a><br>
<a href="index.html">Home</a>
and:

<p><a href="admin_menu.html" class="small">Click here to modify the
'Home' menu section</a></p>
<a href="index.html">Home</a>
My problem is that <p> is not valid inside a <dt>, but the <br> places a
vertical break at the bottom of the <dt> in the UA which looks decidedly
out-of-place. I'm using styles to make everything look nice. Is there a way
to add a newline between the <a>'s which won't add a vertical break?

You can see it in action at:
http://www.plankmeister.org.uk/new/a...e_section.html

If you mouseover the the "click here to..." above Home you'll see it looks
wrong, compared to the one above Photography. The top one however, validates
while the one below doesn't.
P.
Jul 20 '05 #1
6 3879
"The Plankmeister" <pl******************@hotmail.com> wrote:
I'm trying to achieve a newline effect within a <dt> block, but am
having problems.
The simplest and safest solution is to stop using <dl>. First, you
haven't got a _definition list_, have you? Second, <dl> elements are
displayed in a primitive manner, and it's more difficult to fix that in
CSS than to start from something simpler and style it. More info:
http://www.cs.tut.fi/~jkorpela/def.html#impl
<dt>
<a href="admin_menu.html" class="small">Click here to
modify the
'Home' menu section</a>
<a href="index.html">Home</a>
You are not presenting a _definition_ for the _term_ "Click here to
modify the 'Home' menu section Home", are you? Au contraire, you
_postulate_ (often incorrectly) that the user knows your definition for
the word "Home" in this context.
And here are the two ways I've tried to place a newline between the
<a>'s in the <dt>:
The first method, <br>, is technically correct for the purpose stated.
It does not, however, help e.g. a blind person who is listening to your
page, since line breaks are usually insignificant then.
My problem is that <p> is not valid inside a <dt>,
Yes, that makes the second method rather suspicious. And isn't it
pretty obvious that a _definition term_ must not contain a paragraph?
but the <br>
places a vertical break at the bottom of the <dt> in the UA which
looks decidedly out-of-place. I'm using styles to make everything
look nice.
Well, <br> creates a line break, which is what you said what you
wanted. The rest seems to be about styles, hence off-topic here.
Is there a way to add a newline between the <a>'s which
won't add a vertical break?


Are you asking how to break a line without breaking a line, or are you
asking for help with your CSS?

In either case, I would say you are asking a wrong question. You are
probably fighting, in part, with some problems that you created by
using <dl>, for no good reason.

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

Jul 20 '05 #2

"The Plankmeister" <pl******************@hotmail.com> wrote in message
news:3f***********************@dread11.news.tele.d k...
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
'Home' menu section</a>
<a href="index.html">Home</a>
</dt>
<dd><a href="index.html">Me!</a></dd>
<dd><a href="index.html">Oz &amp; N.Z.</a></dd>
<dd><a href="index.html">Stuff</a></dd>
</dl>


Wow. Those sure are some weird definitions.
--
Karl Core

In heaven all the interesting people are missing.
Friedrich Nietzsche

eightninethree AT eightninethree.com
Jul 20 '05 #3
"The Plankmeister" <pl******************@hotmail.com> wrote:
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
'Home' menu section</a>
<a href="index.html">Home</a>
</dt>
<dd><a href="index.html">Me!</a></dd>
<dd><a href="index.html">Oz &amp; N.Z.</a></dd>
<dd><a href="index.html">Stuff</a></dd>
</dl>
So "Me!", "Oz & N.Z" and "Stuff" are definitions of the term "Click
here to modify the Menu menu section Home" ?

Interesting.
And here are the two ways I've tried to place a newline between the <a>'s in
the <dt>:
But you've already set a {display: block} in your CSS, so there is
already a line break between the two links anyway.

Or put the two links in two different <dt>s. Why not use two <dt>s
instead of one? (Assuming that you decide to continue not caring about
telling lies by claiming that these are definition terms.) Just tweak
the CSS accordingly.
My problem is that <p> is not valid inside a <dt>, but the <br> places a
vertical break at the bottom of the <dt> in the UA which looks decidedly
out-of-place. I'm using styles to make everything look nice. Is there a way
to add a newline between the <a>'s which won't add a vertical break?


Yes, take out the <br> and just let the CSS do it's work.

Or stop abusing the <dl>, <dt> and <dd> elements and use something
more appropriate like nested <ul>s instead.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>
Jul 20 '05 #4
Wow. Those sure are some weird definitions.


I get the impression that abusing tags 'round these parts is heresy. Points
taken. I guess I should rework the menu into <ul>'s then.
Or is even using nested <ul>'s bad? What is the best way of constructing a
menu?
Jul 20 '05 #5

"The Plankmeister" <pl******************@hotmail.com> wrote in message
news:3f***********************@dread11.news.tele.d k...
Wow. Those sure are some weird definitions.
I get the impression that abusing tags 'round these parts is heresy.

Points taken. I guess I should rework the menu into <ul>'s then.
Or is even using nested <ul>'s bad? What is the best way of constructing a
menu?


Think of it in context of what it is: A list of links. If there's no
specific order to them, then use <ul>
Nested <ul> is fine, if nesting is indeed needed.

For instance, a list of V8 engines:

<ul>
<li>Dodge
<ul>
<li>318</li>
<li>340</li>
<li>360</li>
</ul>
</li>
<li>Chevy
<ul>
<li>262</li>
<li>283</li>
<li>302</li>
</ul>
</li>
<li>Ford
<ul>
<li>289</li>
<li>302</li>
<li>351</li>
</ul>
</li>
</ul>
--
Karl Core

In heaven all the interesting people are missing.
Friedrich Nietzsche

eightninethree AT eightninethree.com
Jul 20 '05 #6
"The Plankmeister" <pl******************@hotmail.com> wrote in message news:<3f***********************@dread11.news.tele. dk>...
I'm trying to achieve a newline effect within a <dt> block, but am having
problems.
[snip]
My problem is that <p> is not valid inside a <dt>


No, your problem is that you are using definition list markup for
something that is not a list of definitions. Try instead a combination
of <p>s and an unordered list, wrapped in a <div> with an appropriate
class - then add the CSS to get read of the list markers and perform
other desired formating within that <div>.

--- Stephen Morley ---
http://www.safalra.com
Jul 20 '05 #7

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

Similar topics

2
by: AES/newspost | last post by:
In a markup like <dd> <br> some other stuff <br> </dd> the first break seems to add a blank line before the other stuff, but the second doesn't add a blank line after the other stuff. 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...
0
by: Dan Trowbridge | last post by:
He everyone, I just getting started with .NET and I am having a porting problem. I get and error in code that lookes like this (really stripped down but you get the idea)... class dt {...
7
by: Dan Trowbridge | last post by:
He everyone, I am just getting started with .NET and I am having a porting problem. I get and error in code that lookssomething like this (really stripped down but you get the idea)... class...
2
by: Jasonkimberson | last post by:
I am doing a data pull of HTML from a database that will be put into a drop down menu currently after i pull and populate the information, it converts my < into &lt; whats the work around for...
13
by: onetitfemme | last post by:
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...
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...
8
by: michael | last post by:
Hi all A client of mine is having a problem with their site and when I looked into the SQL database, I found that most text fields have been altered and appended with script...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
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
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,...
0
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...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.