Jump to content

ordered list


simpli

Recommended Posts

Expanding on fry2010's post, you might try this:

 

Supposing your ordered list has a div that wraps it with a  class of myOrderedList...

 

.myOrderedList {

    float: left;

    width: 500px;

}

 

.myOrderedList ol{

    float: left;

}

 

.myOrderedList li{

    float: left;

    width: 100px;

}

.myOrderedList input{

    width: 100px;

}

 

 

What I'm doing there is floating everything (but the input) to the left since that sort of attaches it all together and any border or bg you might put on that div wrapper will fit nicely, instead of sliding up under the ordered list.

 

The div has a width of 500px which can fit 5 input's/li's.

 

If you add any padding/margin/border to either the ol/li/input, you'll have to increase the 500px width on the div wrapper.

 

Link to comment
https://forums.phpfreaks.com/topic/150994-ordered-list/#findComment-793433
Share on other sites

that . represents a 'class'

 

You know there are two types of css declerations yeah? They are id and class.

You call id once in your page and is represented as such:  <p id="my_id">

You can call a class multiple times on a page as such:  <p class="my_class">

 

The in your style sheet you have:

for the id:  #my_id { ..... }

for the class:  .my_class { ...... }

 

For the above class you have .myOrderedList { ....}

You need to place this in the html element you want to have these attributes as such:

<ol class="myOrderedList">

 

If you are going to use Floydians example you still need to use the

display: inline;

attribute in your

.myOrderedList li { ..... }

 

So looks like this:

 

.myOrderedList li{

float: left;

width: 100px;

display: inline;

}

 

Both methods will do what you require.

Link to comment
https://forums.phpfreaks.com/topic/150994-ordered-list/#findComment-793511
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.