embedded div's? what's the problem here?

Discussion in 'Web Design and Development' started by yojitani, Jul 9, 2007.

  1. yojitani macrumors 68000

    yojitani

    Joined:
    Apr 28, 2005
    Location:
    An octopus's garden
    #1
    Hi,

    I'm modifying (heavily) a wordpress template so I can get a department here running their site on WP (they need something that is very basic to edit). However, I'm having a problem with one of sidebars. Basically, I need to list a bunch of links with subheadings and to do this properly, I need to use a different style sheet from the rest of the sidebar. The problem I'm having is that I'm getting this huge gap between the bottom of the list and the next heading (<h2>Archives</h2>). I'm going to post the code here and hope that someone here can tell me where I'm going wrong.

     
  2. Sdashiki macrumors 68040

    Sdashiki

    Joined:
    Aug 11, 2005
    Location:
    Behind the lens
    #2
    be easier with the full code, including the needed style sheet or tags?
     
  3. epochblue macrumors 68000

    epochblue

    Joined:
    Aug 12, 2005
    Location:
    Nashville, TN
    #3
    During my first glance at the code, I'm noticing lots of unclosed <ul> tags...I don't know if that's the problem, but it's A problem.
     
  4. jng macrumors 65816

    jng

    Joined:
    Apr 6, 2007
    Location:
    Germany
    #4
    I think epoch is right. it's the unclosed <ul> tags.

    If I remember correctly, Wordpress uses embedded <ul> tags to build its sidebar like so:

    HTML:
    <ul id="sidebarSections">
    	<li>
        	<ul>Section 1
            	<li>item in section 1</li>
                <li>item in section 1</li>
            </ul>
        </li>
        <li>
            <ul>Section 2
            	<li>item in section 2</li>
                <li>item in section 2</li>
            </ul>	
    	</li>
    </ul>
    

    So close the tags properly and you should be fine.
     
  5. yojitani thread starter macrumors 68000

    yojitani

    Joined:
    Apr 28, 2005
    Location:
    An octopus's garden
    #5
    Thanks for the feedback all, but the closed tags are not the problem. I was actually borrowing the code structure from some link through wordpress that I can't actually find right now. See, the problem with closing the tags for each set is that it creates a huge gap between list items. The list appears to be a better fit with the closed tags, but that is only because everything is so much more spaced out. The problem may be with the tags, but not because they are open.

    Edit = nevermind. Just some goofy css -
     
  6. epochblue macrumors 68000

    epochblue

    Joined:
    Aug 12, 2005
    Location:
    Nashville, TN
    #6
    Regardless of whether the unclosed tags were the problem, they need to be closed. You can fix the margins with CSS after the fact if need be, but for proper markup structure (and just general correctness), an unclosed tags *need* to be closed.
     
  7. jng macrumors 65816

    jng

    Joined:
    Apr 6, 2007
    Location:
    Germany
    #7
    Agreed.

    And it's not longer "borrowed" once you've edited it. And Edits-> Problems. I'd hate to see what the site would look like in IE or something with all the unclosed tags.
     
  8. yojitani thread starter macrumors 68000

    yojitani

    Joined:
    Apr 28, 2005
    Location:
    An octopus's garden
    #8
    of course. here's the page I was referring to under the heading "improper tag structure". I was treating each category as additional sub-categories. But at any rate, I realized when I went back this morning that the ul ul ul li combination in the CSS was not being used by the original designer, so I simply popped that in, made a few other changes to the stylesheet, deleted the embedded div and all was good... oh, and I could close those tags too!

    Oddly enough, even with the unclosed tags, IE 6 or 7 (whichever one is installed on my colleague's computer) displayed the list fine.
     
  9. epochblue macrumors 68000

    epochblue

    Joined:
    Aug 12, 2005
    Location:
    Nashville, TN
    #9
    Yeah - that kind of thing is one of my bigger gripes with the IE rendering engine...it's entirely too forgiving with things like that.
     

Share This Page