Results 1 to 8 of 8

Thread: how make odd css

  1. #1
    Join Date
    Sep 2013
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default how make odd css

    How make css with two class like odd and even?

  2. #2
    Join Date
    Mar 2010
    Location
    Florida
    Posts
    512
    Thanks
    9
    Thanked 61 Times in 59 Posts

    Default

    .odd {}
    .even {}

    however i dont think that is what you are asking.

  3. #3
    Join Date
    Jan 2011
    Location
    England
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Good evening,

    Is this what you want?

    Code:
    <!DOCTYPE HTML>
    <html>
    <head>
    	<title>Complete Template</title>
    	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    	<link rel="stylesheet" type="text/css" href="style.css" />
    	<link rel="stylesheet" type="text/css" href="font_style.css" />
    	<script type="text/javascript" src="jquery-1.8.3.js"></script>
    	
    <style type="text/css">
    	ol li:nth-child(odd)
    	{
    		color: red;
    	}
    </style>
    </head>
    
    <body>
    
    <ol>
    	<li>this is first</li>
    	<li>this is second</li>
    	<li>this is third</li>
    	<li>this is fourth</li>
    </ol>
    
    </body>
    </html>
    Kind regards,

    LC.

  4. #4
    Join Date
    Sep 2013
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    No in toplists there two class one by one example:red class white class and again red class again white class

  5. #5
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    What is "toplists"?

    Please include a link to the page on your site that contains the problematic code so we can check it out.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  6. #6
    Join Date
    Sep 2013
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Like this site I want to add in my site that blue and green class of music album category

    http://123musiq.mobi/songs/1/latest
    Last edited by jscheuer1; 09-22-2013 at 02:46 PM. Reason: Format

  7. #7
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    That server isn't resolving at the moment. But, from the description you give, it sounds like LearningCoder's answer is what you're looking for. Perhaps you just don't know how to use it. I mean, this can be done various ways, LearningCoder's solution is a good one. Or it might be something else you're looking for, Did you try LearningCoder's solution?
    Last edited by jscheuer1; 09-22-2013 at 02:57 PM.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  8. #8
    Join Date
    Jan 2011
    Location
    England
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Good evening all,

    You can always add:
    Code:
    <!DOCTYPE HTML>
    <html>
    <head>
    	<title>Complete Template</title>
    	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    	<link rel="stylesheet" type="text/css" href="style.css" />
    	<link rel="stylesheet" type="text/css" href="font_style.css" />
    	<script type="text/javascript" src="jquery-1.8.3.js"></script>
    	
    <style type="text/css">
    	ol li:nth-child(odd)
    	{
    		color: red;
    	}
         
            ol li:nth-child(even)
    	{
    		color: green;
                    font-weight: bold;
    	}
    </style>
    </head>
    
    <body>
    
    <ol>
    	<li>this is first</li>
    	<li>this is second</li>
    	<li>this is third</li>
    	<li>this is fourth</li>
    </ol>
    
    </body>
    </html>
    That way you can style the odd and even list items exactly how you want without assigning a class to each and every other list item.

    Or you could in theory I suppose:

    Let's say you are styling all the 'odd' list items. Give your whole list a default style (style it how you would like the EVEN list items to appear, then just add the ol li:nth-child(odd) declaration to change the odd list items.

    Your question was quite vague so not sure exactly what you're looking for!

    Put the whole code above in a new HTML file and run the file!

    Kind regards,

    LC

Similar Threads

  1. How can I make a div go on top of another div?
    By Johnnymushio in forum CSS
    Replies: 2
    Last Post: 03-27-2011, 12:47 AM
  2. How can I make my div not do this?
    By lord_havoc in forum CSS
    Replies: 0
    Last Post: 07-10-2007, 05:41 AM
  3. Replies: 10
    Last Post: 03-05-2007, 07:12 PM
  4. Replies: 3
    Last Post: 09-02-2006, 07:34 AM
  5. Help Make$
    By insanemonkey in forum Graphics
    Replies: 4
    Last Post: 11-17-2005, 12:03 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •