Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > center <ol> in <div>

Reply
Thread Tools

center <ol> in <div>

 
 
Shank
Guest
Posts: n/a
 
      08-12-2006
In the below, how do I get the <ol> block to center in the <div>?
I've tried: <ol style="text-align:left; margin-left:auto;
margin-right:auto"> no luck!
I want the <ol> to remain left aligned, but the whole block centered on the
page.
thanks!

<div style="font-family:Arial, Helvetica, sans-serif; text-align:center;
padding:20px; background-color:#FFFF00; color:#990000">
<p style=" padding:3px">
xxxxxxxxxxxxxxxxxxxxx<br>
xxxxxxxxxxxxxxxxxxxxx</p>
<img src="300.jpg" border="0">
<p style="color:#990000; font-size:120%">xxxxxx</p>
<ol style="text-align:left">
<li>xxxxx</li>
<li>xxxxx</li>
<li>xxxxx</li>
<li>xxxxx</li>
<li>xxxxx</li>
<li>xxxxx</li>
</ol></div>



 
Reply With Quote
 
 
 
 
David Dorward
Guest
Posts: n/a
 
      08-12-2006
Shank wrote:

> In the below, how do I get the <ol> block to center in the <div>?
> I've tried: <ol style="text-align:left; margin-left:auto;
> margin-right:auto"> no luck!


That is centered, you just can't see it as it spans the entire width of the
div as you haven't set a width on it.

http://dorward.me.uk/www/centre/

> I want the <ol> to remain left aligned, but the whole block centered on
> the page.


So shouldn't you be centring the div then?


--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
 
Reply With Quote
 
 
 
 
Shank
Guest
Posts: n/a
 
      08-12-2006

"David Dorward" <(E-Mail Removed)> wrote in message
news:ebk8dj$7fo$1$(E-Mail Removed)...
> Shank wrote:
>
>> In the below, how do I get the <ol> block to center in the <div>?
>> I've tried: <ol style="text-align:left; margin-left:auto;
>> margin-right:auto"> no luck!

>
> That is centered, you just can't see it as it spans the entire width of
> the
> div as you haven't set a width on it.
>
> http://dorward.me.uk/www/centre/
>
>> I want the <ol> to remain left aligned, but the whole block centered on
>> the page.

>
> So shouldn't you be centring the div then?
>
>
> --
> David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>

----------------------------------
I was not aware the <ol> spanned the whole distance. My goof! How do I set
the width of the <div> where it will accommodate changing widths in the
<ol>? I don't want the <ol> to wrap text onto next lines. I guess what I
need is a collapse attribute for the <div>.
thanks


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Compatibility Issues -- Windows Media Center and Wireless Adapters =?Utf-8?B?RG91Z2ggRG9jdG9y?= Wireless Networking 2 10-30-2005 11:15 PM
Beblu 'component' Media Center PC at bit-tech Silverstrand Front Page News 0 10-12-2005 01:43 PM
Naming of core NASA center with the words "Mission Control Center" & mass use of religious anthem sounding word "Mission" in Context of Space Exploration & the Moon Landing Hoax moonlandinghoaxreligious@yahoo.com Digital Photography 0 09-27-2005 08:28 PM
Microsoft's Application Center Test Tool Maximus ASP .Net 0 12-10-2003 07:07 PM
About Application Center Test Maximus ASP .Net 0 12-10-2003 07:01 PM



Advertisments