Solved

getting rid of the gap above <ul>

Posted on 2006-12-01
7
385 Views
Last Modified: 2008-03-03
can sum1 help?

i have a title - remember, then on the next line start my <ul>

the ul seems to have a default top margin or something as there is a gap there........

how can i get rid of this?
0
Comment
Question by:scm0sml
  • 2
  • 2
  • 2
  • +1
7 Comments
 
LVL 13

Expert Comment

by:rhickmott
ID: 18052306
Odd UL doesent normally have any white space above it what does the source look like?
0
 

Author Comment

by:scm0sml
ID: 18052323
<tr>
<td>
       <b><u><i>Remember</i></u></b><ul>
       
        <li><b><i>Pre Book your Ski / Snowboard Hire, Lift Pass &amp; Lessons</i></b></li>
 and then obviously other <li>'s then close the </td>
0
 
LVL 30

Expert Comment

by:irwinpks
ID: 18052326
You may want to consider using tables and rows.. This allows you to size accordingly with spacers.

The <ul> tag doesn't allow any formatting in size.

if there is a space above, then check for <p><br> or any "whitespace" in your hard code.
0
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.

 
LVL 19

Accepted Solution

by:
DreamMaster earned 500 total points
ID: 18052328
Hi scm0sml,

Yes it DOES have white space above it. Like P, Table, Form...UL also generates an extra line break. Notice the difference between:

<ul>
  <li>Item 1</li>
  <li>Item 2</li>
</ul>

and:

<li>Item 1</li>
<li>Item 2</li>

However that's not really a solution, since that doesn't behave the same way a normal unordered list would. You will have to use stylesheets to get the extra spacing away, that is...if you can even get it fully away.

The following style should do the trick..

<style>
UL { margin: 0em; }
</style>

Regards,
Max.
0
 
LVL 13

Expert Comment

by:rhickmott
ID: 18052346
What you need is

<tr>
<td>
           <b><u><i>Remember</i></u></b>

          <ul style="margin-top: 0px">
                <li><b><i>Pre Book your Ski / Snowboard Hire, Lift Pass &amp; Lessons</i></b></li>
             <li>List Item 2</li>
             <li>List Item 3</li>
         </ul>
</td>
0
 

Author Comment

by:scm0sml
ID: 18052348
yes!! very good thatnks dreammaster
0
 
LVL 19

Expert Comment

by:DreamMaster
ID: 18052354
Glad to have helped scm0sml :)

Regards,
Max.
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

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

867 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