Please help me make <li> inline

Discussion in 'HTML & Website Design' started by 530, Jan 4, 2007.

  1. #1
    Hi,

    My friend ask me to help him with his website [URL="http://www.seobangkok.com/index-ae.html]here[/URL]. Please take a look at "Recent Blog Post" and you will see that he is using <li> tag but they're not inline (2 of 2007 should inline with S from SEO in the first, not too much left.). Here is his stylesheet

    li.a1 {
    	margin-left: 0;
    	padding-left: 1em;
    	text-indent: -1em;
    	}
    Code (markup):
    He use <ul> and <li class="a1"> in his html page. How to make its list inline?

    cheers
     
    530, Jan 4, 2007 IP
  2. Cypherus

    Cypherus Peon

    Messages:
    1,551
    Likes Received:
    102
    Best Answers:
    0
    Trophy Points:
    0
    #2
    on the <ul>, set "display: inline"

    ul.class { display:inline; }
     
    Cypherus, Jan 4, 2007 IP
  3. 530

    530 Banned

    Messages:
    124
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #3
    :D Thank you for your help but I gave the wrong URL at first time, please take a look again. However, your given solution didn't work.

    cheers
     
    530, Jan 4, 2007 IP
  4. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #4
    A combnation of
    
    display: inline;
    float: left;
    
    Code (markup):
    should do the trick.
     
    Dan Schulz, Jan 4, 2007 IP
  5. 530

    530 Banned

    Messages:
    124
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Thank you very much Dan but which place in css should I put this code to, ul or li. However, I tried to put in both and it didn't work.

    cheers
     
    530, Jan 4, 2007 IP
  6. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #6
    the list item itself. What is the full code for your list? (I have way too many tabs open in Opera right now and am not about to open another one or a different browser.)
     
    Dan Schulz, Jan 4, 2007 IP
  7. 530

    530 Banned

    Messages:
    124
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Here is full code (my friend use Carp to read feeds from blog)
    
    CarpConf('iorder','link');
    CarpConf('bi','<ul class="a1">');
    CarpConf('bi','<li class="a1">');
    CarpConf('maxitems',4);
    //No Title
    CarpConf('cborder',' '); 
    CarpConf('caorder',' '); 
    CarpCacheShow('http://www.seobangkok.com/blog/feed/');
    CarpConf('ai','</li>');
    CarpConf('ai','</ul>');
    Code (markup):
    Here is his stylesheet.

    ul.a1 {
    	display:inline
    	float: left;
    	}
    li.a1 {
    	margin-left: 0;
    	padding-left: 1em;
    	text-indent: -1em;
    	}
    Code (markup):
    I've got a headache to help his site :(

    cheers
     
    530, Jan 4, 2007 IP
  8. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #8
    What is the HTML output of that? (CSS doesn't care about PHP since it can't see it - it has access only the HTML output and dynamically generated client-side scripting output.)
     
    Dan Schulz, Jan 4, 2007 IP
  9. JEET

    JEET Notable Member

    Messages:
    3,832
    Likes Received:
    502
    Best Answers:
    19
    Trophy Points:
    265
    #9
    Try this:

    ul.a1 {
    }
    li.a1 {
    display: inline;
    margin-left: 0;
    padding-left: 1em;
    text-indent: -1em;
    }
    Bye :)
     
    JEET, Jan 4, 2007 IP
  10. 530

    530 Banned

    Messages:
    124
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #10
    :D Thanks, Carp script can make html and css access and usable but in their format like I show you.
    
    CarpConf('bi','<ul class="a1">');
    CarpConf('bi','<li class="a1">');
    Code (markup):
    Above code is mean before each news feed it will put "UL" and "IL" we prefered. However I had problem that I show you about inline of each news. When title of news longer than display in one line they will not inline when they enter new line. :eek: I tried to use CSS to fix this problem but it didn't work. Thank you very much again, if you have any suggestion please tell me.

    cheers
     
    530, Jan 4, 2007 IP
  11. 530

    530 Banned

    Messages:
    124
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #11
    Thank you very much JEET but I tried and it didn't work too. The bullet do not show and still not inline.

    cheers
     
    530, Jan 4, 2007 IP
  12. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #12
    Ugh... can you post the complete URL to the page? I noticed that the link in your first post isn't set up properly, so I can't even open it up.
     
    Dan Schulz, Jan 4, 2007 IP
  13. 530

    530 Banned

    Messages:
    124
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #13
    http://www.seobangkok.com/index-ae.html :D

    cheers
     
    530, Jan 4, 2007 IP
  14. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #14
    Ok, I thnk I see the problem now. Part of it is that your page does not validate.
    I'd start by fixing those HTML validaton errors (the HTML validator is at http://validator.w3.org ), then check to see if the stylesheet is valid at http://jigsaw.w3.org/css-validator/
     
    Dan Schulz, Jan 4, 2007 IP
  15. JEET

    JEET Notable Member

    Messages:
    3,832
    Likes Received:
    502
    Best Answers:
    19
    Trophy Points:
    265
    #15
    I am not sure what you are trying to do on that site. See this code below. You have started a <li> tag without opening a <ul> tag.
    <<td>font color="#333333" size="1" face="Arial, Helvetica, sans-serif"><li class="a1">
    There are many similar errors.
    Try fixing these simple html errors and I think your inline will work.
    I have attached a file with a sample list inline. Same code as mentioned in previous post. See how it works...
    Bye :)
     

    Attached Files:

    • j1k.php
      File size:
      257 bytes
      Views:
      216
    JEET, Jan 4, 2007 IP