对齐的div中心旁边的海誓山盟与VALIGN:顶部海誓山盟、中心、div、VALIGN

2023-09-11 23:36:22 作者:老板给我来一碗泪流满面

取这里看看 http://www.basenharald.nl/3d 。 对于家庭的一部分,我把一些黑色的边框,所以你可以明白我的意思。

Take a look here http://www.basenharald.nl/3d. For the home part i put on some black borders so you can see what i mean.

问题: 我需要放置2块(以下简称嘿嘿块和右部)彼此相邻的中心,他们个人从那里出位置。 逻辑的做法是使用显示:内联块。现在的问题是,它不VALIGN顶部,所以我不能边距定位。

The problem: I need to position the 2 blocks (the "hey"block and the right part) next to each other in the center and position them individual from there on out. The logical thing to do is to use display: inline block. Now the problem is that it does not valign top, so i cannot position them with margins.

基本上我想要做的是位置的哎的部分略向左侧和右的部分稍微向右和向下达

Basically what i want to do is position the "hey"part slightly to the left and the "right"part slightly to the right and a tat downwards.

什么是这样做的最佳方法是什么?它需要为中心的透视效果和决议的所有时间的原因。 希望我足够清楚的,否则就问我。

What is the best way to do so? It needs to be centered all time cause of the perspective effect and resolutions. Hope i am clear enough, otherwise just ask.

这是CSS的一部分,我说的是:

this is the css part i am talking about:

#home-welkom { text-align:left; width: 465px; margin: 360px 400px 100px; 230px; margin: 0 auto; display: inline-block;  color:#787778; font-size:11px; border:1px solid black; }
#home-right { text-align:left; width: 330px; margin: 50px 0px 0 0; position: relative; margin: 0 auto; display: inline-block; border:1px solid black; }

也不是margin属性完全不影响的div

Also not that the margin property does not influence the divs at all

推荐答案

你将不得不重新考虑你的设计策略。这里有几个指针:

You're going to have to rethink your design strategy. Here's a few pointers:

使用div的,而不是列出来布置你的页面(名单是好菜单等) 利润率只能使用一次每类中使用 使用DIV浮动并排放置你的div身边 存储你的JavaScript的外部这样你的code将清洁剂

现在你的问题,这是你在找什么来定位你的元素:

Now for your question this is what you're looking for to position your elements:

<div id="wrapper" style="position: relative; margin: 0 auto; width: 800px; text-align: left">
<div id="leftcol" style="float: left; width: 400px;">left column</div>
<div id="rightcol" style="float: left; width: 400px;">right column</div>
</div>

最后,我会确保和验证我的code,你可以在这里做的:的http://验证。 w3.org/

希望这有助于。

 
精彩推荐
图片推荐