我对此很陌生,非常感谢一些指导。我想用css将我的图像放在div中。我已经使用了内联元素,它仍然出现在图像下面。这里是我的代码为我的用户界面按钮:需要CSS定位帮助
#UIButtons {
position:fixed;
top: 50%;
left: 40%;
width:45em; /* this is correct and displays how I want it to*/
height:18em;
margin-top: -9em;
margin-left: -15em;
background: url(backtabss.png);
}
#UIButtons ul{ /* this has set the height ok*/
position:relative;
top: 9%;
right: 50%;
width:45em;
}
#UIButtons li {/*not sure what this is doing to be honest*/
position:relative;
top: 70%;
left: 45%;
display: inline; /* this is not working my images are appearing vertical*/
padding: 40px;
}
我已经评论了代码,让你知道发生了什么。 HTML是:
<div id="UIButtons">
<ul>
<li><a href="tutorials.html"><img src="beginBUT.png" alt="Click to start Tutorials" title=" Click this button to start Tutorials" width="300" height="250"/></a></li>
<li><a href="sChords.html"><img src="beginCHO.png" alt= "Click to view Chord Sheet" title=" Click this button to view Chord Sheet" width="300" height="250"/></a></li>
</ul>
</div>
谢谢你的时间。我看过这里的其他建议,但没有人帮助我,实际上它让我更加困惑!
您需要填写的详细信息..至少框架问题发布之前..它不能创建一个jfiddle – Andy897
真的令人困惑的问题不知道你想要什么吗? –
考虑倾向于使用像[Twitter Bootstrap](http://getbootstrap.com/getting-started/)这样的良好文档的CSS框架,并保持它非常简单。像这样的框架的好处是,你不需要知道或写入CSS。请按照他们在文档中提供的示例进行操作。以下是一些[Bootstrap示例](http://getbootstrap.com/getting-started/#examples)来帮助您入门。 –