Solved

Centering elements in li tags

Posted on 2014-09-08
2
96 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
Comment Utility
#steps li {
    ...
    ...
    text-align: center;
}

Open in new window

0
 
LVL 2

Author Comment

by:Panos
Comment Utility
Hi Gary
Thank you for your help.
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

744 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now