Forum Moderators: open

Message Too Old, No Replies

Using divs instead of tables - does Dreamweaver know something I don't

         

smallfry

6:29 pm on Nov 12, 2003 (gmt 0)

10+ Year Member



I'm slowly getting the hang of using CSS instead of tables for page layout. On the site I'm currently working on I have The main content of the page is laid out in two divs (.leftcontent and .rightcontent).

However, when it comes to lists within a positioned div I have a problem that affects our clients using contribute and/or Dreamweaver's design mode (I get round it in code view, but that's not an option for our clients).

Whithin these divs I want to add an unordered list as part of the inline content. Like this >


<div class="leftcolumn">
<p> some text </p>
<p> some more text </p>
<ul>
<li>One</li>
<li>Two<li>
</ul>
<p> some more text </p>
</div>

This seems to work in the browsers I have tried it in. However if I use design mode inDreamweaverMX (I know, I know) to convert pre-existing paragraphs into a list I get the following >

 
<div class="leftcolumn">
<p> some text </p>
</div>
<ul>
<li><div class="leftcolumn">One</div></li>
<li><div class="leftcolumn">Two</div><li>
</ul>
<div class="leftcolumn">
<p> some more text </p>
</div>

Since .leftcolumn is floated left with a width of 64% this gives a wacky appearence.

So basically I need to know if

(a) my code is OK (i.e. 'legal' CSS) and Dreamweaver is choking for some reason known best to itself or

(b) I've done something very stoopid!

Many thanks
Peter

PS How do I get my code in those nice bordered boxes?

[edited by: Nick_W at 6:32 pm (utc) on Nov. 12, 2003]

Hollerith

12:21 am on Dec 9, 2003 (gmt 0)

10+ Year Member



Unless you actually want the break (paragraph-spaced break) that <DIV> gives you, why not use <SPAN>...</SPAN>? I find that Dreamweaver is excessively liberal with its automatic inserting of the <DIV> tag, but doesn't pretend to use <SPAN>, i.e. I've never found unwanted <SPAN> tags shoved in my code. I prefer <SPAN> because I don't like the break that <DIV> creates.

Mr_Z

6:49 pm on Dec 11, 2003 (gmt 0)

10+ Year Member



I don't know of any CSS rules that you have broken, and I can't think of any reason why DW would do this. Hollerith is incorrect that if you use SPAN instead of DIV this wouldn't happen, because it does. My only advice to you is not to use the Design mode to do it. It could be that this issue is resolved in DW MX 2004, but I don't know for sure.

smallfry

9:56 pm on Dec 11, 2003 (gmt 0)

10+ Year Member



Mr_Z

Many thanks. I might try DW2004.....