The width between parent and children of list, and vertical centering parent

benking12345

New Member
I am not sure how should I explain but I want to auto width the area(space) between item 1 and 2. I am not sure it is ul or li....Also I want to verticalize item 1 to the center of its children. I tried so many ways to deal with CSS, but I couldn't fine a solution. Please help and advice.Now is like\[code\]----- -------| P | I want to be like this -> | C |----- ------- ----- ------- ------- | C | | P | | C | ----- ------- ------- ----- ------- | C | | C | ----- ------- ----- | C | ----- the width of P will auto change\[/code\]CSS\[code\].div { border: 1px solid #666; overflow: hidden; display: table; height: 30px; width: 100px;}ul{ list-style:none; }\[/code\]HTML\[code\]<ul> <li> <div class="div">Item 1</div><ul> <li> <div class="div">Item 1.1</div></li><li> <div class="div">Item 1.2</div></li><li> <div class="div">Item 1.3</div></li><li> <div class="div">Item 1.4</div></li></ul></li><li> <div class="div">Item 2</div></li><li> <div class="div">Item 3</div></li><li> <div class="div">Item 4</div></li></ul>\[/code\]
 
Back
Top