Solved

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

Posted on 2013-06-11
4
609 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
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 500 total points
ID: 39238180
Do you mean like this
http://jsfiddle.net/uJ7fQ/
0
 
LVL 54

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

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
paypal ipn url 5 57
Make Line Items Look Good Over Mobile 2 58
Wordpress plugins not working in html 3 22
asp.net input html code have it display the content 2 11
This article discusses how to create an extensible mechanism for linked drop downs.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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 style different bullet points for unordered lists in CSS. Begin with a normal unordered list; the default bullet point is a solid circle: In the CSS, create a defined class of unordered list by typing "ul.S…

770 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