Solved

getting rid of the gap above <ul>

Posted on 2006-12-01
7
389 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

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

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.
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 style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
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 …

724 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