Solved

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

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

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Read text on Table 7 44
Word Press Fixes to Google Speed Test Issues 2 47
Need advice on an App idea......but who do I ask? 2 66
Want my table columns to autofit. 7 53
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.
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.
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
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…

740 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