English 中文(简体)
在这个例子中, 如何分辨高度属性?
原标题:How to sort out the height property in this example?

在模式窗口中设置内容的高度属性时出现问题 。

我希望模式窗口中的内容达到100%,但问题在于它只是高达大约30%。 为什么这种情况会发生,我怎样才能得到模式窗口中的内容才能填满模式窗口,而不能填满大约30%,从而使滚动条成为可能?

下面是模式窗口的宽度,很好:

#simplemodal-container {height:75%; width:50%;}

下面是一框架的高度和宽度 :

$.modal( <iframe src="  + src +  " style="border:0;width:100%;height:100%;"> );

下面是进入模式窗口的内容(我确实将这个高度设定为100%, 但后来我无法让它工作, 所以它目前没有高度属性 :

<div id="previouslink">
<button type="button" id="close" onclick="return parent.closewindow();">Close</button>
<h1>PREVIOUS QUESTIONS</h1>

<p>Search for a previous question by entering in a phrase in the search box below and submitting the phrase</p>

<form action="previousquestions.php" method="post" id="modalform">
      <p>Search: <input type="text" name="questioncontent" value="<?php echo $questioncontent; ?>" /></p>
      <p><input id="searchquestion" name="searchQuestion" type="submit" value="Search" /></p>
      </form>

</div>

您可以通过访问 < a href=> 访问此 link 来查看模式窗口, 然后点击附加按钮 。

谢谢

最佳回答

添加此样式 :

#simplemodal-data {height: 100%}
问题回答

如果文档正文本身没有填充窗口 - 文档高度低于窗口高度, 则可能发生这种情况。 通常情况下, 解决方案是这样的 :

body {
  padding-bottom: 1500px;
}

或者,如果你把你的代码带进一个真实的环境, 在那里,文档总是比窗口高, 这可能不会是一个问题。





相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签