Solved

CSS: problem with extra space

Posted on 2011-09-06
5
637 Views
Last Modified: 2012-05-12
Hello, I have a problem with script from dynamicdrive dhtml.
http://www.dynamicdrive.com/dynamicindex1/navigate1.htm
I have extra space on the left of the list.
wich style or changes do I add to avoid these extra spaces.
I tried some solution that was working with safari/chrome and not with IE9.

Thanks for your help. in red the extra space
<HTML>
<head>
<script type="text/javascript" src="simpletreemenu.js">
/***********************************************
* Simple Tree Menu- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/
</script>
<link rel="stylesheet" type="text/css" href="simpletree.css" />
</head>
<BODY>
<ul id="treemenu1" class="treeview">
<li>Item 1</li>
<li>Item 2</li>
<li>Folder 1
	<ul>
	<li>Sub Item 1.1</li>
	<li>Sub Item 1.2</li>
	</ul>
</li>
<li>Item 3</li>
<li>Folder 2
	<ul>
	<li>Sub Item 2.1</li>
	<li>Folder 2.1
		<ul>
		<li>Sub Item 2.1.1</li>
		<li>Sub Item 2.1.2</li>
		</ul>
	</li>
</ul>
</li>
<li>Item 4</li>
</ul>
<script type="text/javascript">
ddtreemenu.createTree("treemenu1", true)
</script>
</BODY>
</HTML>

Open in new window

simpletree.css
0
Comment
Question by:bruno_boccara
  • 2
  • 2
5 Comments
 
LVL 30

Expert Comment

by:LZ1
ID: 36489525
Try giving the .treeview a CSS style of padding:0;

Like this in your treemenu.css:

.treeview {padding:0;}
0
 

Author Comment

by:bruno_boccara
ID: 36489634
Already tried.
it works with Chrome and Safari.
it does not work with IE9....
0
 
LVL 30

Accepted Solution

by:
LZ1 earned 500 total points
ID: 36489649
If your page is as simple as you've posted, first you should start out with a reset CSS to alleviate cross-browser defaults.

http://meyerweb.com/eric/tools/css/reset/

Paste that CSS before any other CSS and then let us know.
0
 
LVL 8

Expert Comment

by:Jen0910
ID: 36489760
If LZ1's suggestion doesn't work, I would change your CSS to ID's and eliminate the need to call a separate class. Line 13 of your HTML would look like this: <ul id="treeview">

and your CSS:
#treeview ul{ /*CSS for Simple Tree Menu*/
margin: 0;
padding: 0;
}

#treeview li{ /*Style for LI elements in general (excludes an LI that contains sub lists)*/
background: white url(list.gif) no-repeat left center;
list-style-type: none;
padding-left: 22px;
margin-bottom: 3px;
}

#treeview li.submenu{ /* Style for LI that contains sub lists (other ULs). */
background: white url(closed.gif) no-repeat left 1px;
cursor: hand !important;
cursor: pointer !important;
}

#treeview li.submenu ul{ /*Style for ULs that are children of LIs (submenu) */
display: none; /*Hide them by default. Don't delete. */
}

#treeview .submenu ul li{ /*Style for LIs of ULs that are children of LIs (submenu) */
cursor: default;
}

Open in new window


Strange as it sounds, have seen positioning oddities utilizing classes before. I try to us them only for text/visual styles, and leave my positioning (margins, padding, etc.) to div IDs. Hope that helps.
0
 

Author Closing Comment

by:bruno_boccara
ID: 36490138
so simple !!

thanks a lot.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now