Solved

getting rid of the gap above <ul>

Posted on 2006-12-01
7
386 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
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 
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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

786 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