问题描述
我正在开发一家餐馆的网站。
我的模板有div#content然后div#navigation,其中包含
无序列表的链接。我已使用以下内容定位div#navigation左侧
方:
BODY {
margin-left:9.6em ;
}
#navigation {
职位:绝对;
宽度:9em;
身高:100%;
top:0;
底部:0;
左:0;
}
我想在div#navigation中添加一个图形,一个140px宽的gif文件。
我画过吗我自己陷入了困境?如何将图像放在
#navigation中,并确保
图像和文本链接有足够的空间?
-
Brian
按照我地址中的说明给我发电子邮件
I''m developing a restaurant''s website.
http://www.tsmchughs.com/
My template has div#content then div#navigation, which contains an
unordered list of links. I have positioned div#navigation on the left
side using the following:
BODY {
margin-left: 9.6em;
}
#navigation {
position: absolute;
width: 9em;
height: 100%;
top: 0;
bottom: 0;
left: 0;
}
I''d like to add a graphic to div#navigation, a 140px wide gif file.
Have I painted myself into a corner? How can I place the image in
#navigation and be sure that there is adequate space for both the
image and the text links?
--
Brian
follow the directions in my address to email me
推荐答案
您可以这样做:
< div id =" navigation">
< img src =" foo"> ;
< ul> ...文字链接...< / ul>
< / div>
如果9em<你可能遇到麻烦; 140 px,这取决于用户的设置。
Garmt。
You can just do:
<div id="navigation">
<img src="foo">
<ul> ...Text links... </ul>
</div>
You could get into trouble if 9em < 140 px, which depends on the user''s settings.
Garmt.
这篇关于混合宽度和定位的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!