<ifrarme>
标签的大小设置,Django填入<ifrarme>
标签后自动设置大小
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
.container{
width: 1700px;
height:500px;
margin: 0 auto;
border: 1px solid #f00;
text-align: center;
}
iframe{
border: 1px solid #000;
width: 1700px;
height: 600px;
}
</style>
</head>
<body>
<div class="container">
{% autoescape off %}
{{ info }}
{% endautoescape %}
</div>
</body>
</html>
def bofang(request):
context={
"info":'<iframe src="//player.bilibili.com/player.html?aid=455345011&bvid=BV1x5411x7kE&cid=179274496&page=1" scrolling="yes" border="0" frameborder="no" framespacing="0" allowfullscreen="true" > </iframe>'
}
return render(request,"bofang.html",context=context)