473,785 Members | 2,847 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Ordered List

Hello,

I have the following:

<ol id ="ol">
<li id="li1">item1 </li>
<li id="li2">item2 </li>
<ol>

Is it possible to display the List Items on the horizontal, i.e., side
by side instead of one List Item per line?
And can I make li1 Width = 20% and li2 Width = 80%?

How can I do this using CSS?

Thanks,
Miguel

Jun 3 '07 #1
20 2927
On Jun 3, 2:49 pm, shapper <mdmo...@gmail. comwrote:
Is it possible to display the List Items on the horizontal, i.e., side
by side instead of one List Item per line?
use a UL and
display:inline-block;
or
float:left
on LIs
And can I make li1 Width = 20% and li2 Width = 80%?
#li1{width:20%}
#li2{width:80%} ??
Jun 3 '07 #2
In article
<11************ ********@a26g20 00pre.googlegro ups.com>,
"scripts.contac t" <sc************ *@gmail.comwrot e:
On Jun 3, 2:49 pm, shapper <mdmo...@gmail. comwrote:
Is it possible to display the List Items on the horizontal, i.e., side
by side instead of one List Item per line?

use a UL and
display:inline-block;
or
float:left
on LIs
Perhaps you might give an example using these alternatives you
mention.

--
dorayme
Jun 4 '07 #3
On Jun 3, 7:56 pm, dorayme <doraymeRidT... @optusnet.com.a uwrote:
Is it possible to display the List Items on the horizontal, i.e., side
by side instead of one List Item per line?
use a UL and
display:inline-block;
or
float:left
on LIs

Perhaps you might give an example using these alternatives you
mention.
-HTML-

<ul>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
<li>Item 4</li>
<li>Item 5</li>
<li>Item 6</li>
</ul>

-STYLE-

li {display:inline-block;border:1p x dotted gray}

Jun 4 '07 #4
dorayme wrote:
In article
<11************ ********@a26g20 00pre.googlegro ups.com>,
"scripts.contac t" <sc************ *@gmail.comwrot e:
>On Jun 3, 2:49 pm, shapper <mdmo...@gmail. comwrote:
>>Is it possible to display the List Items on the horizontal, i.e., side
by side instead of one List Item per line?
use a UL and
display:inline-block;
or
float:left
on LIs

Perhaps you might give an example using these alternatives you
mention.
LI { display: inline; }

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
Jun 4 '07 #5
Scripsit scripts.contact :
>Perhaps you might give an example using these alternatives you
mention.
- -
li {display:inline-block;border:1p x dotted gray}
Perhaps next time you will actually test your proposed solution before
posting it, _at least_ on the dominant browser.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

Jun 4 '07 #6
On 2007-06-03, shapper <md*****@gmail. comwrote:
Hello,

I have the following:

<ol id ="ol">
<li id="li1">item1 </li>
<li id="li2">item2 </li>
<ol>

Is it possible to display the List Items on the horizontal, i.e., side
by side instead of one List Item per line?
Setting display: inline on the list items will do that.
And can I make li1 Width = 20% and li2 Width = 80%?
But you can't set width on inlines, so make them float: left instead. If
they have any borders, padding or margin you'll need to make the total
add up to a bit less than 100%.

Inline-block would be ideal, but isn't supported by Firefox.
Jun 4 '07 #7
On Jun 3, 10:24 pm, "Jonathan N. Little" <lws4...@centra lva.net>
wrote:
On Jun 3, 2:49 pm, shapper <mdmo...@gmail. comwrote:
Is it possible to display the List Items on the horizontal, i.e., side
by side instead of one List Item per line?
use a UL and
display:inline-block;
or
float:left
on LIs
Perhaps you might give an example using these alternatives you
mention.

LI { display: inline; }
but then you cant set width .

Jun 4 '07 #8
In article
<11************ **********@r19g 2000prf.googleg roups.com>,
"scripts.contac t" <sc************ *@gmail.comwrot e:
On Jun 3, 7:56 pm, dorayme <doraymeRidT... @optusnet.com.a uwrote:
Is it possible to display the List Items on the horizontal, i.e., side
by side instead of one List Item per line?
use a UL and
display:inline-block;
or
float:left
on LIs
Perhaps you might give an example using these alternatives you
mention.

-HTML-

<ul>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
<li>Item 4</li>
<li>Item 5</li>
<li>Item 6</li>
</ul>

-STYLE-

li {display:inline-block;border:1p x dotted gray}
This is not an ordered list. I asked because while the ul one is
quite straightforward , the <olone is just that more tricky to
get right, no? To get the numbers in too remember... and to look
reasonable.

--
dorayme
Jun 4 '07 #9
On Jun 4, 10:40 am, dorayme <doraymeRidT... @optusnet.com.a uwrote:
In article
<1180924483.736 184.314...@r19g 2000prf.googleg roups.com>,

"scripts.contac t" <scripts.cont.. .@gmail.comwrot e:
On Jun 3, 7:56 pm, dorayme <doraymeRidT... @optusnet.com.a uwrote:
Is it possible to display the List Items on the horizontal, i.e., side
by side instead of one List Item per line?
use a UL and
display:inline-block;
or
float:left
on LIs
Perhaps you might give an example using these alternatives you
mention.
-HTML-
<ul>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
<li>Item 4</li>
<li>Item 5</li>
<li>Item 6</li>
</ul>
-STYLE-
li {display:inline-block;border:1p x dotted gray}

This is not an ordered list. I asked because while the ul one is
quite straightforward , the <olone is just that more tricky to
get right, no? To get the numbers in too remember... and to look
reasonable.

--
dorayme
Hi,

I just found this web site:
http://css.maxdesign.com.au/listamatic/

Really nice.

Thanks,
Miguel

Jun 4 '07 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

33
3917
by: Jim Cobban | last post by:
I cannot get Netscape 4.79 to properly display the ordered list in the following fragment. <P>Get a specific portion of the date. Depending upon the value of index: <ol start=0> <li>complete value, usually as a <code>String</code>, or if an integral value as an <code>Integer</code>. <li>year as an <code>Integer</code> <li>month number as an <code>Integer</code>
210
10556
by: Christoph Zwerschke | last post by:
This is probably a FAQ, but I dare to ask it nevertheless since I haven't found a satisfying answer yet: Why isn't there an "ordered dictionary" class at least in the standard list? Time and again I am missing that feature. Maybe there is something wrong with my programming style, but I rather think it is generally useful. I fully agree with the following posting where somebody complains why so very basic and useful things are not part...
8
1673
by: Fuzzyman | last post by:
Sorry for this hurried message - I've done a new implementation of out ordered dict. This comes out of the discussion on this newsgroup (see blog entry for link to archive of discussion). See the latest blog entry to get at it : http://www.voidspace.org.uk/python/weblog/index.shtml Criticism solicited (honestly) :-) We (Nicola Larosa and I) haven't yet made any optimisations - but there
22
2375
by: bearophileHUGS | last post by:
>From this interesting blog entry by Lawrence Oluyede: http://www.oluyede.org/blog/2006/07/05/europython-day-2/ and the Py3.0 PEPs, I think the people working on Py3.0 are doing a good job, I am not expert enough (so I don't post this on the Py3.0 mailing list), but I agree with most of the things they are agreeing to. Few notes: - input() vanishes and raw_input() becomes sys.stdin.readline(). I think a child that is learning to program...
1
3334
by: rllioacvuher | last post by:
I need help with a program. I have implemented that following header file with an unordered list using one array, but i need to be able to use an ordered list and 2 arrays (one for the links and one to use as an index to the freearray cells). Here is the exact problem specifications: Create an ordered list template class named OLType to implement an ordered list with operations of insert, remove, print, empty, full, size. The storage...
5
14200
by: Lee Brotzman | last post by:
Hi, I have a sequence of data tables in an ordered list, like this: <ol> <li><table></table></li> <li><table></table></li> </ol> However it renders on the page with the list item number next to the
33
12222
by: Andreas Prilop | last post by:
To get bold numbers in ordered lists, one can write ol { font-weight: bold } ol span { font-weight: normal } <ol> <li><span>......</span></li> <li><span>......</span></li> </ol>
16
3669
by: some old html fumbler | last post by:
I want to use CSS to get an ordered list to start with something other than a 1 or equivalent. I have a list of things that happen during the course of a year. Too long a list is not helpful, so I only show maybe 3 months of items at a time. The items have to be ordered according to the year, IOW I can't list something in April as being #1. In HTML after the first couple of months I just use this sort of code: <ol start="14"...
0
9645
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10330
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10153
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7500
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6740
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5381
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4053
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3654
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.