Solved

Centering elements in li tags

Posted on 2014-09-08
2
98 Views
Last Modified: 2014-09-08
Hello experts
I have list of elements and i use this for "steps" function.
I need help to center the I, II, III, a.s.o. in the list too.
Any help?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>
      Untitled Document
    </title>
    <style type="text/css">
	#steps{ list-style:none; width:100%; overflow:hidden; margin:0px; padding:0px;}
    #steps li {font-size:22px; float:left; padding:10px; color:#b0b1b3;}
    #steps li.first {float:left; padding-left:0px !important; color:#b0b1b3;}
    #steps li span {display:block;font-size:14px;}
    #steps li.current { color:#8F7861;}
	</style>
  </head>
  
  <body>
    <ul id="steps">
      <li class="first" id="stepDesc1">
        &nbsp;I
        <span>
          Blablablabla
        </span>
      </li>
      <li class="" id="stepDesc2">
        &nbsp;II
        <span>
          Blablablabla
        </span>
      </li>
      <li class="" id="stepDesc3">
        &nbsp;III
        <span>
          Blablablabla
        </span>
      </li>
      <li class="current" id="stepDesc4">
        &nbsp;IV
        <span>
          Blablaa
        </span>
      </li>
      <li class="" id="stepDesc5">
        &nbsp;V
        <span>
          Blablablabla
        </span>
      </li>
      <li class="" id="stepDesc6">
        &nbsp;VI
        <span>
         Blablablablabla
        </span>
      </li>
    </ul>
  </body>
</html>

Open in new window

0
Comment
Question by:Panos
2 Comments
 
LVL 58

Accepted Solution

by:
Gary earned 500 total points
ID: 40310486
#steps li {
    ...
    ...
    text-align: center;
}

Open in new window

0
 
LVL 2

Author Comment

by:Panos
ID: 40310521
Hi Gary
Thank you for your help.
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question