0

我正在编写一个嵌入 iframe 的谷歌小工具。iframe 有一个 body 元素。页面的高度非常大。我无法弄清楚这个高度是从哪里来的,我使用了“height:auto”,但高度仍然保持不变。有一个 css 文件会影响身高。

一个代码是

body {
    font-family: 'PT Sans';
    background-color: #acacac;
    background-image: url(i/n1.png);
    font-size: 14px;
    color: #f5f5f5;
    background-attachment: fixed;
    -moz-transition-duration: .4s;
    -o-transition-duration: .4s;
    -webkit-transition-duration: .4s;
    transition-duration: .4s;
}

body .container>.row-fluid>.span10>h4 {
    margin-bottom: 30px;
    padding-bottom: 10px;
    text-align: center;
    -ms-text-shadow: none;
    -o-text-shadow: none;
    -moz-text-shadow: none;
    -webkit-text-shadow: none;
    text-shadow: none;
}

body .heading-4 {
    margin-bottom: 30px;
    padding-bottom: 10px;
    text-align: center;
    -ms-text-shadow: none;
    -o-text-shadow: none;
    -moz-text-shadow: none;
    -webkit-text-shadow: none;
    text-shadow: none;
}

body.light {
    background-color: #ececec;
    color: #454545;
}

body.dark {
    background-color: #464646;
    color: #e6e6e6;
}

body .tabbable {
    color: #454545;
}

body .tabbable.dark {
    color: #e6e6e6;
}

body .tabbable.dark .tab-pane a {
    color: #61caff;
}

body .tabbable.dark .tab-pane a:hover {
    color: #90daff;
}

body .tabbable.grey {
    color: #f8f8f8;
}

body .tabbable.grey .tab-pane a {
    color: #61caff;
}

body .tabbable.grey .tab-pane a:hover {
    color: #90daff;
}

谁能告诉我如何设置身体高度,以使其占据其内容所占据的空间

.in chrome 工具栏中显示

/* Computed Style */

-webkit-transition-duration: 0.4000000059604645s;
body - .4s
background-attachment: fixed;
background-color: rgb(172, 172, 172);
background-image: url(http://cloudfactor9.appspot.com/i/n1.png);
color: rgb(245, 245, 245);
direction: ltr;
display: block;
font-family: 'PT Sans';
font-size: 14px;
height: 1633px;
line-height: 20px;
margin-bottom: 0px;
margin-left: 0px;
margin-right: 0px;
margin-top: 0px;
padding-bottom: 0px;
padding-left: 0px;
padding-right: 0px;
padding-top: 0px;
unicode-bidi: embed;
width: 1254px;

/* Styles */
:active :hover
:focus  :visited

匹配的 CSS 规则 preview.min.css

body {
    font-family: 'PT Sans';
    background-color: #acacac;
    background-image: url('http://cloudfactor9.appspot.com/i/n1.png');
    font-size: 14px;
    color: #f5f5f5;
    background-attachment: fixed;
    <strike> -moz-transition-duration: .4s;</strike>
    <strike>-o-transition-duration: .4s;</strike>
    -webkit-transition-duration: .4s;
    <strike>transition-duration: .4s;</strike>
}

bootstrap.min.css

body {
    margin: 0;
    <strike>font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;</strike>
    <strike>font-size: 14px;</strike>
    line-height: 20px;
    <strike>color: #333;</strike>
    <strike>background-color: #fff;</strike>
}

ifr

body {    
    <strike>margin: 0px;</strike>
    padding: 0px;
    <strike>background-color: white;</strike>
}

body, td, div, span, p {
    <strike>font-family: arial,sans-serif;</strike>
}

body[Attributes Style] {
    direction: ltr;
    unicode-bidi: embed;
    <strike>margin-right: 0px;</strike>
    <strike>margin-left: 0px;</strike>
    <strike>margin-bottom: 0px;</strike>
    <strike>margin-top: 0px;</strike>
}

用户代理样式表

body {
    display: block;
    <strike>margin: 8px;</strike>
}

继承自 html

html {
    <strike>font-size: 100%;</strike>
}

我读了一本关于 css 的好书,但工作量不大。当我添加 style="height:auto;" 在正文中,我认为它应该使正文的高度与内容可用,但它并没有缩短正文的高度,如何使正文元素的高度达到它所具有的内容。请指导

4

0 回答 0