Home > Web Front-end > HTML Tutorial > Ask for advice on CSS text centering_html/css_WEB-ITnose

Ask for advice on CSS text centering_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:17:21
Original
1061 people have browsed it

This post was last edited by music_vip_2009 on 2012-12-08 00:10:26

<div class="listarticle">	<li>						<a href="#" target="_blank"><img src="http://preview.quanjing.com/rob_pre002/rob-728-4336.jpg" title="" alt=""></a><br>                         <a href="#" title="这里居中显示" target="_blank">这里居中显示</a>                        </li>                        </div>						<style>.listarticle{margin-top:15px;}.listarticle li { float:left; width:250px; line-height:40px; margin:0px 0px 0px 40px;}.listarticle li img{padding:5px; width:220px; height:150px; border:solid 1px #ccc}.listarticle li img:hover{border:solid 1px #87CEEB}.listarticle li a{color:#383838;font-size:14px;font-weight: 500;}.listarticle li a:hover {color:#3A5FCD;-moz-transition:color .2s ease-in;-webkit-transition:color .2s ease-in;-o-transition:color .2s ease-in;transition:color .2s ease-in;}						</style>
Copy after login

Display in the center here
The text in the tag above cannot be displayed in the center. Please give me some advice!

Reply to discussion (solution)

.listarticle li a{ text-align:center;}

I have tried this!
It doesn’t work, boss

.listarticle li a{ text-align:center;}
I’ve already tried this!
It’s not working, boss

Is there anyone else? Help!

valign="middle"

valign="middle"
I’ve tried it all, but it doesn’t work

Thanks bro, I solved it myself!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template