doctype, treeview & CSS issue

N_K

Member
Joined
Oct 10, 2006
Messages
22
Programming Experience
3-5
Hi,

A colleague of mine is using a treeview to generate a site map for the .Net site we're developing. We've hit a problem.

The treeview seems to show a break between a few elements . After raising a query about it it was suggested he change the doctype from this:
VB.NET:
[FONT=Courier New][SIZE=2][COLOR=blue][COLOR=blue][FONT='Courier New']<![/FONT][/COLOR][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=maroon][COLOR=maroon][FONT='Courier New']DOCTYPE[/FONT][/COLOR][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT='Courier New'] [COLOR=red][COLOR=red]html[/COLOR][/COLOR] [COLOR=red][COLOR=red]PUBLIC[/COLOR][/COLOR] [COLOR=blue][COLOR=blue]"-//W3C//DTD XHTML 1.0 Transitional//EN"[/COLOR][/COLOR] [COLOR=blue][COLOR=blue]"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">[/COLOR][/COLOR][/FONT][/SIZE][/FONT]
 [FONT=Courier New][SIZE=2][COLOR=blue][COLOR=blue][FONT='Courier New']<[/FONT][/COLOR][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=maroon][COLOR=maroon][FONT='Courier New']html[/FONT][/COLOR][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT='Courier New'] [COLOR=red][COLOR=red]xmlns[/COLOR][/COLOR][COLOR=blue][COLOR=blue]="http://www.w3.org/1999/xhtml"[/COLOR][/COLOR] [COLOR=blue][COLOR=blue]>[/COLOR][/COLOR][/FONT][/SIZE][/FONT]
to this:

VB.NET:
[FONT=Courier New][SIZE=2][COLOR=blue][COLOR=blue][FONT='Courier New']<![/FONT][/COLOR][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=maroon][COLOR=maroon][FONT='Courier New']DOCTYPE[/FONT][/COLOR][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT='Courier New'] [COLOR=red][COLOR=red]HTML[/COLOR][/COLOR] [COLOR=red][COLOR=red]PUBLIC[/COLOR][/COLOR] [COLOR=blue][COLOR=blue]"-//W3C//DTD HTML 4.0  Transitional//EN">[/COLOR][/COLOR][/FONT][/SIZE][/FONT]
 [FONT=Courier New][SIZE=2][COLOR=blue][COLOR=blue][FONT='Courier New']<[/FONT][/COLOR][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=maroon][COLOR=maroon][FONT='Courier New']html[/FONT][/COLOR][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=blue][COLOR=blue][FONT='Courier New']>[/FONT][/COLOR][/COLOR][/SIZE][/FONT]

It fixes the bug with the treeview but it seems to disable some CSS used on the page. The page is laid out using a table which wits in a container div with a fixed width. This container div is given the 'margin: 0 auto' command in CSS. (I probably could use the text-align attribute but i want to use CSS attributes for their purpose where I can). Changing the doctype as above seems to make the page ignore this margin command which centers the page.

Does anyone have a solution? It seems shocking that .Net 2.0 should enforce us to use an older doctype for the sake of one control.

Id appreciate anything you guys can contribute.

NK

Can anyone
 
Back
Top