?
Solved

Align text vertical middle on bullet points ... HELP!

Posted on 2013-06-11
4
Medium Priority
?
622 Views
Last Modified: 2013-06-27
This problem should be so easy but im struggling with it.

I have 10 links (dynamically pulled from a database). I am using -webkit-columns to separate them into 2 columns. The problem is that some of the link titles are 2 lines, and some are one. I need the text to be aligned centrally to the bullet point (li).

Please see images for problem.... Incorrect is a screen print. CORRECT has been Photoshop to look correct....

 
Examples - IncorrectExample - CORRECT
Could someone advice on the css to correct this.

JSFiddle Simple Example: http://jsfiddle.net/5cjua/1/


<div id="indexLinks">
	<ul>  
<?php
	mysql_data_seek($result, 0);
	while($row = mysql_fetch_array($result)) {
?>


<li><p><a href="otherEntry.php?questionID=<?php echo $row['questionID']; ?>"><?php echo $row['question']; ?></a></p></li>


<?php } ?>
</ul>
</div>

Open in new window







#indexLinks ul {
	float: left;
	list-style: none;
	text-align:left;
}

#indexLinks {
	border:0px solid red;	
	columns:100px 2;
	-webkit-columns:100px 2; /* Safari and Chrome */
	-moz-columns:100px 2; /* Firefox */
	height:510px;


}

#indexLinks ul li a {
	float: left;

	color: #000;
	background: #ccc;
	text-decoration:none;
	color: #00AFFE;
	background-color: #FFF;
	background:url(arrow1.gif) left no-repeat ;
	border-bottom:1px #8C8C8C double;
	padding:30px 0 0 50px;
	font-size:23px;
	width:360px;
	margin:0px;
	height:60px;
}

#indexLinks ul li a:hover, a:active {
	background: #00AEEF;
	color: #CCC;
	background:url(arrow_gray1.gif) left no-repeat ;

}

Open in new window






Thanks

Steve
0
Comment
Question by:Steve Tinsley
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 39238070
On the background-position try left center

If that does not work you might need to use an absolute value in pixels or em for the vertical position.

Cd&
0
 

Author Comment

by:Steve Tinsley
ID: 39238102
Its not the background image that is the problem. This seems to be in the correct position.
Its the text which is only aligning the first line with the bullet point. I want to whole sentence to align itself in the middle of the bullet...
0
 
LVL 58

Accepted Solution

by:
Gary earned 2000 total points
ID: 39238180
Do you mean like this
http://jsfiddle.net/uJ7fQ/
0
 
LVL 58

Expert Comment

by:Julian Hansen
ID: 39238223
The bullet is a background image using the background-postion: left center as CD& suggested should solve the problem - depending on how the image is defined.

You might need to crop your image so that it terminates top and bottom exactly on the corners of the arrow.

This should work as the background-position positions the image relative to the container.

Your fiddle shows a layout wher bullets don't line up horizontally - is that a requirement or not (your attached images seem to indicate it is). If it is not - you can remove the height style from the <a> to make it work correctly. Currently the height on the single line elements is making the container longer so there is more space below the <a> elements on single lines than wrapped lines.

The other option is to look ath the table-cell css property.
0

Featured Post

WordPress Tutorial 1: Installation & Setup

WordPress is a very popular option for running your web site and can be used to get your content online quickly for the world to see. This guide will walk you through installing the WordPress server software and the initial setup process.

Question has a verified solution.

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

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.
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
In this tutorial viewers will learn how to customize the background color and font color of highlighted text using the ::selection element in CSS Begin by defining the selected text as an element in CSS by typing "::selection": Style the ::selection…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …

766 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