如何使用html css强制列表是垂直的 [英] How to force a list to be vertical using html css

查看:132
本文介绍了如何使用html css强制列表是垂直的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个列表,我想添加到< div> 。每个listitem包含一个< div> ,它又包含一个图像和一个文本字符串。列表必须是垂直的。我尝试为< ul> width:100%尝试 display:block 但是列表是从左到右水平。如何使列表垂直?

I have a list i want to add to a <div>. Each listitem contains a <div> which in turn contain an image and a text string. The list must be vertical. I ve tried putting display:block for the <ul> with width:100% but the list is flowing left to right horizontally. How do I make the list vertical?

推荐答案

尝试将 display:block < li> 标记中,而不是< ul>

Try putting display: block in the <li> tags instead of the <ul>

这篇关于如何使用html css强制列表是垂直的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆