开发者

Getting text to display under an image in a navigation

开发者 https://www.devze.com 2022-12-16 23:30 出处:网络
I want my navigation to look like this: <icon><icon><icon> TitleLonger TitleTitle Ideally, I want my code to look like:

I want my navigation to look like this:

<icon>       <icon>       <icon>
Title     Longer Title    Title

Ideally, I want my code to look like:

<li>
    <img src="images/icon.png" />
    <a class="link_title">Title 1</a>
</li>
<li>
    <img src="images/icon.png"/>
    <a class="link_title">Title 2</a>
</li>
<li>
    <img src="images/icon.png"/>
    <a class="link_title">Title 3</a>
</li>

I already have it horizontal, but not sure how to get the link to appear right under the i开发者_如何学Gocon, without using a table, which I don't want to do. (Let me know if I must, though.)


li { text-align:center; }
li a.link_title { display:block; }

Also, you're closing your <a> tags with a </span>. This needs to be corrected:

<a class="link_title">Some Text</a>


try this:

li {
float:left;
text-align:center;
}

li a {
display:block;  
}

li img {
margin:0 auto;  
}
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号