Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 09-28-2012, 10:52 AM   PM User | #1
Pervez
New Coder

 
Join Date: Jul 2012
Posts: 15
Thanks: 1
Thanked 0 Times in 0 Posts
Pervez is an unknown quantity at this point
li side by side

Hi,

Below is my code, Here I want place main li side by side.how can i do this.....?
Here the inner li can expand/collapsed .

<form action=# >
<ul class="tree" >
<li>
<input type="checkbox">
<label>Select All</label>
<ul id="double">
<li><input class="cate" type='checkbox' name='' id='p_1'value='1'><label>AAAAAAAAAAAAAA</label>
<ul>
<li><input type='checkbox' name='0' id='p_10'value='1'><label>aaaaaaaa</label></li>
<li><input type='checkbox' name='1' id='p_11'value='1'><label>bbbbbbbb</label></li>
</ul>
</li>
<li><input type='checkbox' name='' id='p_1'value='1'><label>BBBBBBBBBBBB</label>
<ul>
<li><input type='checkbox' name='2' id='p_10'value='1'><label>aaaaaaa</label></li>
<li><input type='checkbox' name='3' id='p_11'value='1'><label>bbbbbbb</label></li>
<li><input type='checkbox' name='4' id='p_12'value='1'><label>ccccccc</label></li>
<li><input type='checkbox' name='5' id='p_11'value='1'><label>ddddddd</label></li>
</ul>
</li>
<li><input type='checkbox' name='' id='p_1'value='1'><label>CCCCCCCCCCCCC</label>
<ul>
<li><input type='checkbox' name='7' id='p_10'value='1'><label>aaaaa</label></li>
</ul>
</li>
<li><input type='checkbox' name='' id='p_1'value='1'><label>DDDDDDDDDDDDDD</label>
<ul>
<li><input type='checkbox' name='8' id='p_12'value='1'><label>aaaaaaaaa</label></li>
<li><input type='checkbox' name='9' id='p_11'value='1'><label>bbbbbbbbb</label></li>
<li><input type='checkbox' name='10' id='p_12'value='1'><label>cccccccc</label></li>
</ul>
</li>
<li><input type='checkbox' name='11' id='p_1'value='1'><label>EEEEEEEEEEEEE</label></li>
<li><input type='checkbox' name='' id='p_1'value='1'><label>FFFFFFFFFFFFFFF</label>
<ul>
<li><input type='checkbox' name='12' id='p_12'value='1'><label>aaaaaaaaaa</label></li>
<li><input type='checkbox' name='13' id='p_11'value='1'><label>bbbbbbbbbb</label></li>
</ul>
</li>
</ul>
</li>
</ul>
</form>
Pervez is offline   Reply With Quote
Old 09-28-2012, 12:59 PM   PM User | #2
Rowsdower!
Senior Coder

 
Rowsdower!'s Avatar
 
Join Date: Oct 2008
Location: Some say it's everything.
Posts: 2,007
Thanks: 5
Thanked 395 Times in 388 Posts
Rowsdower! has a spectacular aura aboutRowsdower! has a spectacular aura aboutRowsdower! has a spectacular aura about
Quote:
Originally Posted by Pervez View Post
Hi,

Below is my code, Here I want place main li side by side.how can i do this.....?
Here the inner li can expand/collapsed .

Code:
<form action=# >
<ul class="tree" >
<li>
<input type="checkbox">
    <label>Select All</label>
        <ul id="double">
    <li><input class="cate" type='checkbox' name='' id='p_1'value='1'><label>AAAAAAAAAAAAAA</label>
	    <ul>
		<li><input type='checkbox' name='0' id='p_10'value='1'><label>aaaaaaaa</label></li>
		<li><input type='checkbox' name='1' id='p_11'value='1'><label>bbbbbbbb</label></li>
	    </ul>
    </li>
    <li><input type='checkbox' name='' id='p_1'value='1'><label>BBBBBBBBBBBB</label>
        <ul>
	    <li><input type='checkbox' name='2' id='p_10'value='1'><label>aaaaaaa</label></li>
	    <li><input type='checkbox' name='3' id='p_11'value='1'><label>bbbbbbb</label></li>
	    <li><input type='checkbox' name='4' id='p_12'value='1'><label>ccccccc</label></li>
	    <li><input type='checkbox' name='5' id='p_11'value='1'><label>ddddddd</label></li>
	</ul>
    </li>
    <li><input type='checkbox' name='' id='p_1'value='1'><label>CCCCCCCCCCCCC</label>
        <ul>
	    <li><input type='checkbox' name='7' id='p_10'value='1'><label>aaaaa</label></li>
	</ul>
    </li>
    <li><input type='checkbox' name='' id='p_1'value='1'><label>DDDDDDDDDDDDDD</label>
        <ul>
	    <li><input type='checkbox' name='8' id='p_12'value='1'><label>aaaaaaaaa</label></li>
	    <li><input type='checkbox' name='9' id='p_11'value='1'><label>bbbbbbbbb</label></li>
	    <li><input type='checkbox' name='10' id='p_12'value='1'><label>cccccccc</label></li>
	</ul>
    </li>
    <li><input type='checkbox' name='11' id='p_1'value='1'><label>EEEEEEEEEEEEE</label></li>
    <li><input type='checkbox' name='' id='p_1'value='1'><label>FFFFFFFFFFFFFFF</label>
        <ul>
	    <li><input type='checkbox' name='12' id='p_12'value='1'><label>aaaaaaaaaa</label></li>
	    <li><input type='checkbox' name='13' id='p_11'value='1'><label>bbbbbbbbbb</label></li>
	</ul>
    </li>
	</ul>
</li>
</ul>
</form>
For future reference, please wrap your code in [CODE][/CODE] tags. It makes things much easier to read.

That said, give this a try:

Code:
ul.tree>li{float:left;}
That makes any <li> element that is a DIRECT descendent of the ul.tree element have a left float. Any <li> elements who are children of a <ul> or <ol> of the ul.tree itself will NOT have a left float as long as you use the ">" designation in your CSS rule.
__________________
The object of opening the mind, as of opening the mouth, is to shut it again on something solid. –G.K. Chesterton
See Mediocrity in its Infancy
It's usually a good idea to start out with this at the VERY TOP of your CSS: * {border:0;margin:0;padding:0;}
Seek and you shall find... basically:
validate your markup | view your page cross-browser/cross-platform | free web tutorials | free hosting
Rowsdower! is offline   Reply With Quote
Old 09-28-2012, 01:30 PM   PM User | #3
fireplace_tea
New Coder

 
Join Date: Sep 2012
Location: Boulder, CO
Posts: 56
Thanks: 5
Thanked 0 Times in 0 Posts
fireplace_tea is an unknown quantity at this point
You can also set li to display: inline and see if you like that effect.

Code:
li{
  display: inline;
}
fireplace_tea is offline   Reply With Quote
Reply

Bookmarks

Tags
css, html

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

Forum Jump


All times are GMT +1. The time now is 09:14 AM.


Advertisement
Log in to turn off these ads.