css - 我如何移动这个 block ?

标签 css position css-position word-wrap

我是编码新手,如果这是一个基本问题,我很抱歉。我试图将文本放在屏幕的左侧,将表格放在屏幕的右侧。我已设法准确定位这两个元素,但由于某种原因,文本被迫错误地换行。

我试图让文本看起来像这样:

“雇用你不会雇用的人才
能够负担得起明天!”

但是,CSS 中的某些内容强制文本像这样换行:

“雇佣你不会雇佣的人才
成为
明天买得起!”

我认为这与我将表单放置在文本右侧的方式有关。这是控制文本的 CSS:

.SimpleText { width:928px; margin:50px auto  auto  auto; padding-top: 18px; height:90px;} 
.SimpleText h2 { color:#fff; font:normal 30px  Georgia, "Times New Roman", Times, serif;     padding:0 0 0 40px; margin:0; background:url(images/h2_bg_simple_text.gif) left no-repeat;}<br>
.SimpleText p { color:#bbe2ed; font:normal 11px  Georgia, "Times New Roman", Times, serif; padding:0 0 0 60px; margin:0;}

这是管理表单的 css:

#formtest{ position: relative; float: right; left: 100px;}

这是它在 html 页面中的显示方式:

  <div class="SimpleText">
      <div id="formtest">

          <!--form is here !-->

      </div>

    <h2>Hire the talent you won't be <br />able to afford tomorrow!</h2>
    <p>Great talent you can depend upon</p>

  </div>

我怎样才能修复它以使其正确包装?谢谢。

此外,表单位于 iframe 内。这是 iframe 的代码:

<script type="text/javascript">document.write(unescape("%3Ciframe id=\"fb_iframe\"     src=\"formio.php" + window.location.search + "\" width=\"560\" height=\"677\"allowtransparency=\"true\" scrolling=\"no\" frameborder=\"0\"%3E&lt;a href=\"new_Form.php\" title=\"new_Form\"&gt;blan&lt;/a&gt;%3C/iframe%3E"));</script>
<noscript>
<iframe width="560" height="677" style="border:none; background:transparent;   overflow:hidden;"
 id="formfas" src="axyform.html">
&lt;a href="formio.php" title="new_Form"&gt;m&lt;/a&gt;
</iframe>
</noscript>

最佳答案

您可以通过扩展.SimpleText 的宽度来解决这个问题。例如:

.SimpleText {
    width:968px;
}

JS Fiddle Example

关于css - 我如何移动这个 block ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14966356/

相关文章:

html - 滚动时如何使菜单栏固定在顶部

html - 将动态高度 div 定位在可见屏幕部分的顶部?

javascript - jQuery UI 相对于两个元素的位置

css - 网站上的定位元素有问题

html - 某些元素不受使用伪类后的 z-index 的影响

javascript - CSS 图像没有覆盖整个屏幕

css - html 元标记未检测设备宽度?

javascript - svg.js - 如何从 SVG 文本元素获取 X 位置

jquery - Owl Carousel 坏了

html - <a> 按钮的位置不固定其位置