如何在菜单旁边放置此文本? [英] How do I position this text next to my menu?

查看:69
本文介绍了如何在菜单旁边放置此文本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想拥有它的地方





图片中显示的菜单的css代码:





ul {

list -style-type:none;

margin:0;

padding:0;

宽度:200px;

背景色:#f1f1f1;

}

li a {

display:block;

color: #000;

填充:8px 16px;

text-decoration:none;

}

li a:悬停{

背景颜色:#555;

颜色:白色;

}





(我不知道这对你有用)



我不知道如何定位我旁边的文字

注意我知道如何居中它。



我尝试了什么:



我在css中乱了一下但是做不到,我开始编码大约2周前所以我不知道sh * t这么说....

The place i want to have it


My css code for the menu shown in the picture:


ul {
list-style-type: none;
margin: 0;
padding: 0;
width: 200px;
background-color: #f1f1f1;
}
li a {
display: block;
color: #000;
padding: 8px 16px;
text-decoration: none;
}
li a:hover {
background-color: #555;
color: white;
}


(I don't know if this is helpful for you)

I don't know how to position my text next to it
Note i do know how to center it.

What I have tried:

I messed around a bit in css but couldn't do it, i started coding about 2 weeks ago so i don't know sh*t so to say....

推荐答案

两件事:

1 - 直到你在这里知道,没有人可能点击你提供的任何链接

2 - 将文字换入< div>元素并赋予元素display = inline-block样式。*



还有其他解决方案,例如使用位置样式。即使是浮动风格。最后,如果你将菜单和文本两个相邻的单元格包装在一个表中,那也可以。



*您可能需要将列表放入< div>,以及。现在你要把div彼此相邻 - 独立于他们的内容。
Two things:
1 - until your know enough around here, no one is likely to click any links you supply
2 - Wrap your text in a <div> element and give the element the display=inline-block style.*

There are other solutions, such as using the position style. Even the float style. Finally, if you wrapped the menu and the text two adjacent cells in a table, that would do it, too.

* you may need to put your list in a <div>, as well. Now you'd be putting to div's next to one another - independent of their content.


这篇关于如何在菜单旁边放置此文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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