webdevRefinery Forum: UL creating spacing inside of div element - webdevRefinery Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Rate Topic: -----

User is offline TheEmpty 

  • I say words in sequences.
  • Group: Members
  • Posts: 5154
  • Joined: 02-October 10
  • Expertise:HTML,CSS,PHP,Java,Javascript,Python,Ruby on Rails,SQL

Posted 23 July 2012 - 11:32 PM (#1)

UL creating spacing inside of div element


I have the following UL element in side of a div element. Why is there a spacing between the border and the UL? What can I do to fix this?

Posted Image

Posted Image
Reserved.
0


User is offline ianonavy 

  • Group: Members
  • Posts: 685
  • Joined: 14-April 10
  • Expertise:HTML,CSS,Java,Javascript,Python

Posted 24 July 2012 - 12:14 AM (#2)

Not entirely sure without seeing the raw code (not just WebKit Inspector) but it could be the difference between
<div>
    <ul></ul>
</div>

and
<div><ul></ul></div>

i.e. the whitespace between the tags.

Edit: nvm, I think it's
border-bottom
on the
div
.
Edit 2: Okay, I see the real problem and I'm looking into it more. xD
reputation += 1 if post.is_helpful else 0
0


User is offline markbrown4 

  • Group: Members
  • Posts: 385
  • Joined: 17-May 10
  • LocationMelbourne, Austraila
  • Expertise:HTML,CSS,Javascript,Ruby on Rails,Graphics

Posted 24 July 2012 - 02:30 AM (#3)

Why display: inline-block ?

Inline elements have all of extra lines for positioning text, e.g baseline, descender..
0


User is online @Tom 

  • space
  • Group: Members
  • Posts: 704
  • Joined: 24-May 11
  • Locationspace
  • Expertise:Python

Posted 24 July 2012 - 08:53 AM (#4)

Plus doesn't ie not support inline-block
ocelotapps.com
jr wdR comedian under ThatRailsGuy

View Postarronhunt, on 30 June 2012 - 10:09 PM, said:

Sir you are the first person to make me piss myself laughing. Kudos.
0


User is offline markbrown4 

  • Group: Members
  • Posts: 385
  • Joined: 17-May 10
  • LocationMelbourne, Austraila
  • Expertise:HTML,CSS,Javascript,Ruby on Rails,Graphics

Posted 24 July 2012 - 04:19 PM (#5)

View Post@Tom, on 24 July 2012 - 08:53 AM, said:

Plus doesn't ie not support inline-block

IE8+ has full support for it, before that it was a buggy implementation.

It's more that there's no reason to make the menu anything other than block, that's probably what's causing the space.
0


User is offline TheEmpty 

  • I say words in sequences.
  • Group: Members
  • Posts: 5154
  • Joined: 02-October 10
  • Expertise:HTML,CSS,PHP,Java,Javascript,Python,Ruby on Rails,SQL

Posted 24 July 2012 - 04:44 PM (#6)

I was using it because the div has a background and it needs the spacing. For now I added a height to the div and removed the inline block.
Reserved.
0


Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

2 User(s) are reading this topic
0 members, 2 guests, 0 anonymous users


Enter your sign in name and password


Sign in options
  Or sign in with these services