troubleshooting Question

Something like a 'clear' attribute for <li> elements?

Avatar of SAbboushi
SAbboushiFlag for United States of America asked on
HTMLPHP
2 Comments1 Solution416 ViewsLast Modified:
Is there an attribute or some other mechanism I can use to cause the <li> containing "Item 4:1" to display on the next line (i.e. as if there wasn't enough space for it to fit on the current line even though there is enough space).  Something like the "clear" attribute for floats?  I need a mechism to do this whenever the first <li> element (first of 3 in the <ul>) matches specific criteria.  Thanks--

 
<style>

      ul.ltr#word-by-word-units
      {
        border: 1px solid red;*/
        margin: 0;
        padding: 0;
        direction: ltr;
        text-align: left;
      }


      ul#word-by-word-units li {
        display: inline-block;
        vertical-align: top;
        border: 1px solid Gainsboro;
        margin: 0;
        padding: 0;
      }

      ul#word-by-word-fields
      {
        list-style-type: none; /* no "markers" i.e. bullets */
        border: 1px solid green;
        margin: 0 0 15px 0; /* between each <ul> */
        padding: 0;
      }

      ul#word-by-word-fields li
      {
        vertical-align: top;
        border: 1px solid blue;
        display: block;
        padding: 5px;
      }
</style>

<ul id="word-by-word-units" class="ltr"><li><ul id="word-by-word-fields"><li>Item 1:1</li><li>Item 1:2</li><li>Item 1:3</li></ul><li><ul id="word-by-word-fields"><li>Item 2:1</li><li>Item 2:2</li><li>Item 2:3</li></ul><li><ul id="word-by-word-fields"><li>Item 3:1</li><li>Item 3:2</li><li>Item 3:3</li></ul><li><ul id="word-by-word-fields"><li>Item 4:1</li><li>Item 4:2</li><li>Item 4:3</li></ul><li><ul id="word-by-word-fields"><li >Item 5:1</li><li>Item 5:2</li><li>Item 5:3</li></ul><li><ul id="word-by-word-fields"><li>Item 6:1</li><li>Item 6:2</li><li>Item 6:3</li></ul><li><ul id="word-by-word-fields"><li>Item 7:1</li><li>Item 7:2</li><li>Item 7:3</li></ul></ul>
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 2 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros