Solved

getting rid of the gap above <ul>

Posted on 2006-12-01
7
384 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Summernote and form validation 10 44
Syntax Error 6 32
Animate a Title 7 37
Retrieve values of an HTML form using JQUERY 2 18
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 …
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. 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.: (CODE)

760 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

17 Experts available now in Live!

Get 1:1 Help Now