Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
ul inside div causing problems!!
Old 07-12-2007, 07:55 PM ul inside div causing problems!!
pealo86's Avatar
Super Spam Talker

Posts: 850
Name: Matt Pealing
Location: England, north west
Trades: 0
I have a ul that I have styled using CSS, after A LOT of messing around it suddenly seems to be working how I intended.

But when I insert it into a DIV it loses its margins around the <a> elements! Can anyone figure out why??

HTML:
Code:
    <div class="fifty">
      <ul class="connect">
        <li><a href="#">Content</a></li>
        <li><a href="#">asdfasdf</a></li>
        <li><a href="#">asd</a></li>
        <li><a href="#">fasdf</a></li>
        <li><a href="#">asdfasdf</a></li>
      </ul>
    </div>
CSS:
Code:
ul.connect {
margin:0;
padding:0;
list-style-type:none;
}

ul.connect li {
display:inline
}

ul.connect a {
width:100%;
display:block;
background-color:#323232;
margin-bottom:1px;
}

div.fifty {
width:50%;
display:inline;
float:left;
background-color:#323232;
}
Thanks to those who can help.
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE
pealo86 is offline
Reply With Quote
View Public Profile Visit pealo86's homepage!
 
 
Register now for full access!
Old 07-12-2007, 09:29 PM Re: ul inside div causing problems!!
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
What margins ? You've only specified a 1px bottom margin on the <a> and if you put a border around them you'll see the 1px margin is there.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 07-13-2007, 09:04 AM Re: ul inside div causing problems!!
pealo86's Avatar
Super Spam Talker

Posts: 850
Name: Matt Pealing
Location: England, north west
Trades: 0
hmmm are you sure? Heres how it looks for me in FF2. On the left is the list inside the div, and on the right is the list outside of the div. It looks pretty much the same in IE6 aswell:

http://inspindesign.clawz.com/stuff/Untitled-1.jpg
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE
pealo86 is offline
Reply With Quote
View Public Profile Visit pealo86's homepage!
 
Old 07-13-2007, 09:49 AM Re: ul inside div causing problems!!
pealo86's Avatar
Super Spam Talker

Posts: 850
Name: Matt Pealing
Location: England, north west
Trades: 0
false alarm, Ive just realised i had the background of the div set the same colour as the <a> elements! arghhrghgh!

oh well, it only took me 14 hours to realise it.
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE
pealo86 is offline
Reply With Quote
View Public Profile Visit pealo86's homepage!
 
Old 07-13-2007, 11:48 AM Re: ul inside div causing problems!!
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,938
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades: 0
You're still about 36-60 hours faster than most people that even realize it in the first place, and you're still way ahead of the 95% of people who wouldn't have figured that out.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
(my blog)


Please login or register to view this content. Registration is FREE
(with proof)
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Old 07-13-2007, 12:38 PM Re: ul inside div causing problems!!
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
At least you figured it out.
I did want to say that outside the div your list has no width , inside it's limited to the div's 50% width.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 07-13-2007, 12:49 PM Re: ul inside div causing problems!!
pealo86's Avatar
Super Spam Talker

Posts: 850
Name: Matt Pealing
Location: England, north west
Trades: 0
ahhhh so im not the only one who gets into these situations
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE
pealo86 is offline
Reply With Quote
View Public Profile Visit pealo86's homepage!
 
Reply     « Reply to ul inside div causing problems!!
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.25086 seconds with 12 queries