Solved

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

Posted on 2013-06-11
4
604 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:sjtinsley83
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:sjtinsley83
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 52

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
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…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

895 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