tags:

views:

172

answers:

3

hi! :) i've the following code:

<ul>
<li style="border: 300 red dashed">hello</li>
</ul>

and get something like:

hello


i want to reduce the gap i.e, i want to collapse the border so that it touches the base of the word "hello".. was i clear? :) any help?

+2  A: 

Simple:

<ul>
    <li style="border: 300 red dashed; padding-bottom:2px;">hello</li>
</ul>

Simply change 2px to be whatever you need.

Padding specifies the distance between the content and the border, it might be a benefit to look at the CSS box model, I have mine pinned to my wall for reference.

ILMV
hmmm..ur code increases the gap, rite?i want to reduce the gap ILMV..so, i gave some negative padding..it didn't have any effect :(
almac
Hmmm, can you tell me what line-height you are using?
ILMV
+1  A: 

play with css padding

Update:

    <ul style="margin-bottom:0px;">
        <li style="border: 300 red dashed; ">hello</li>
     </ul>
Saar
the code u gave is used to give margin between ul elements and is no way related to my pro :)
almac
+1  A: 

Try the line-height property and fiddle with the percentage until you like it:

<ul>
  <li style="border: 1px red dashed; line-height:80%;">hello</li>
</ul>

Also, did you really want a 300px border?

Ray
He never specified a 300 pixel border...
ILMV
cool dude..worked fine :)
almac
@almac: I'm glad it worked@ILMV: I looked at the result of his original in a page and saw a huge border, created by this: "border: 300 red dashed"
Ray