Padding-right 无效,请帮忙?
Padding-right has no effect, help please?
这是我的 HTML 和 JS。我已经尝试在 bottomWrapper
和 topList
上添加填充,但出于某种原因,它们似乎都不适用于 padding-right
。其他风格貌似没问题。没有什么是漂浮的或我所知道的任何东西。有任何想法吗?这是 Android 的 WebView,但在这种情况下真的不重要,当我在浏览器中呈现此代码时,我得到相同的行为。
<html>
<head>
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript">
google.load("visualization", "1", {packages:["corechart"]});
google.setOnLoadCallback(drawVisualization);
function drawVisualization() {
// Some raw data (not necessarily accurate)
var data = google.visualization.arrayToDataTable([
['Month', 'Bolivia', 'Ecuador', 'Madagascar', 'Papua New Guinea', 'Rwanda', 'Average'],
['2004/05', 165, 938, 522, 998, 450, 614.6],
['2005/06', 135, 1120, 599, 1268, 288, 682],
['2006/07', 157, 1167, 587, 807, 397, 623]
]);
var options = {
// title : 'Top Texters',
legendTextStyle: { color: 'white' },
// titleTextStyle: { color: 'white' },
vAxis: {
title: "Points",
titleTextStyle: { color: 'white' },
textStyle:
{color: 'white'},
},
hAxis: {
title: "Month",
titleTextStyle: { color: 'white' },
textStyle:
{color: 'white'},
},
seriesType: "bars",
series: {5: {type: "line"}},
backgroundColor: { fill:'transparent' }
};
var chart = new google.visualization.ComboChart(document.getElementById('chart_div'));
chart.draw(data, options);
}
</script>
</head>
<body style="background-color:#02071D;">
<div id="topWrapper" style="width:100%;">
<h1 style="color: white; padding-left: 22px; margin-bottom: -28px;">Top Texters</h1>
<div id="chart_div" style="width: 80%; height: 350px;margin:0 auto;"></div>
</div>
<div id="bottomWrapper" style="width:100%">
<div id="topList" style="width:100%;height:200px;background-color:#FFFFFF;padding:15px;"></div>
</div>
</body>
</html>
div 已退出浏览器窗口。只需给 div 填充一个 box-sizing: border-box;一切都很好!
这是我的 HTML 和 JS。我已经尝试在 bottomWrapper
和 topList
上添加填充,但出于某种原因,它们似乎都不适用于 padding-right
。其他风格貌似没问题。没有什么是漂浮的或我所知道的任何东西。有任何想法吗?这是 Android 的 WebView,但在这种情况下真的不重要,当我在浏览器中呈现此代码时,我得到相同的行为。
<html>
<head>
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript">
google.load("visualization", "1", {packages:["corechart"]});
google.setOnLoadCallback(drawVisualization);
function drawVisualization() {
// Some raw data (not necessarily accurate)
var data = google.visualization.arrayToDataTable([
['Month', 'Bolivia', 'Ecuador', 'Madagascar', 'Papua New Guinea', 'Rwanda', 'Average'],
['2004/05', 165, 938, 522, 998, 450, 614.6],
['2005/06', 135, 1120, 599, 1268, 288, 682],
['2006/07', 157, 1167, 587, 807, 397, 623]
]);
var options = {
// title : 'Top Texters',
legendTextStyle: { color: 'white' },
// titleTextStyle: { color: 'white' },
vAxis: {
title: "Points",
titleTextStyle: { color: 'white' },
textStyle:
{color: 'white'},
},
hAxis: {
title: "Month",
titleTextStyle: { color: 'white' },
textStyle:
{color: 'white'},
},
seriesType: "bars",
series: {5: {type: "line"}},
backgroundColor: { fill:'transparent' }
};
var chart = new google.visualization.ComboChart(document.getElementById('chart_div'));
chart.draw(data, options);
}
</script>
</head>
<body style="background-color:#02071D;">
<div id="topWrapper" style="width:100%;">
<h1 style="color: white; padding-left: 22px; margin-bottom: -28px;">Top Texters</h1>
<div id="chart_div" style="width: 80%; height: 350px;margin:0 auto;"></div>
</div>
<div id="bottomWrapper" style="width:100%">
<div id="topList" style="width:100%;height:200px;background-color:#FFFFFF;padding:15px;"></div>
</div>
</body>
</html>
div 已退出浏览器窗口。只需给 div 填充一个 box-sizing: border-box;一切都很好!