www.webdeveloper.com
Results 1 to 6 of 6

Thread: unordered list

  1. #1
    Join Date
    Nov 2011
    Posts
    137

    unordered list

    I know how to make unordered list. But I would like to know if I can have my CSS on my HTML page, without having to make A CSS file. I would like to be able to have an ordered list side-by-side, in other words to columns.

  2. #2
    Join Date
    Mar 2012
    Posts
    1,644
    Quote Originally Posted by Maxxxx View Post
    I know how to make unordered list. But I would like to know if I can have my CSS on my HTML page, without having to make A CSS file.
    There are good reasons for having the CSS in separate files, but if you wish you can embed the style sheet in the head:
    Code:
    <!DOCTYPE html>
    <html>
    <head>
    <title>Demo</title>
    <meta charset="utf-8">
    <style>
    
    <!-- CSS code goes here -->
    
    </style>
    </head>
    <body>
    
    <!-- HTML code goes here -->
    
    </body>
    </html>
    Quote Originally Posted by Maxxxx View Post
    I would like to be able to have an ordered list side-by-side, in other words to columns.
    Try:
    Code:
    ul {
    list-style:none;
    display:inline;
    }

  3. #3
    Join Date
    May 2014
    Posts
    1,020
    Uhm, @jedaisoul -- I think he mean the list items side-by-side, not the lists themselves... in which case:

    Code:
    ul {
      list-style:none;
    }
    
    li {
      display:inline;
    }
    Though really if it's going to have more than one fixed column in multiple rows, that starts to sound like tabular data, but that's hard to say without seeing the data being marked up.

    Since data should dictate markup and data+markup+device capabilities should dictate layout.

    As to CSS in the markup, that's usually a bad idea. There's a reason I think STYLE as a tag should be made obsolete and as an attribute should be deprecated.
    Java is to JavaScript as Ham is to Hamburger.

  4. #4
    Join Date
    Mar 2012
    Posts
    1,644
    Oops! Thanks DS.

  5. #5
    Join Date
    May 2014
    Location
    bangalore
    Posts
    39
    if you want to displaying your lists are horizontally see the Inline Cascading Style Sheet coding given below

    <!DOCTYPE html>
    <html>
    <head>
    <title>Demo</title>
    <meta charset="utf-8">
    <style>

    ul{
    list-style-type:disc;
    }
    li{
    display:inline;
    }

    </style>
    </head>
    <body>

    <ul>
    <li>list1</li>
    <li>list2</li>
    <li>list3</li>
    <li>list4</li>
    <li>list5</li>
    </ul>
    </body>
    </html>

  6. #6
    Join Date
    Apr 2014
    Location
    New Delhi
    Posts
    27
    unordered list

    <ul>
    <li>Coffee</li>
    <li>Tea</li>
    <li>Milk</li>
    </ul>

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles