我正在用HTML5和Bootstrap 4编写一个网站,我试图将一个方形图像变成一个圆圈.在Bootstrap 3中,这很容易实现.img-circle,但现在我似乎无法使其工作,我无法在线找到任何答案.Bootstrap是否已经删除了img-circle类或者我的代码搞砸了?
它是这样的:
<!-- Within a tab-content div -->
<div class="col-xs-7">
<img src="img/gallery2.JPG" class="img-circle" alt="HelPic>
</div>
Run Code Online (Sandbox Code Playgroud)
希望有人可以帮助我:)
好的,所以我在python中编写成绩检查代码,我的代码是:
unit3Done = str(input("Have you done your Unit 3 Controlled Assessment? (Type y or n): ")).lower()
if unit3Done == "y":
pass
elif unit3Done == "n":
print "Sorry. You must have done at least one unit to calculate what you need for an A*"
else:
print "Sorry. That's not a valid answer."
Run Code Online (Sandbox Code Playgroud)
当我通过我的python编译器运行它并且我选择时"n",我得到一个错误说:
"NameError:名称'n'未定义"
当我选择"y"我再NameError有'y'是问题,但是当我做别的事情,代码运行正常.
任何帮助是极大的赞赏,
谢谢.
我的代码是:
90 if needinexam > 100:
91 print "We are sorry, but you are unable to get an A* in this class."
92 else:
93 print "You need " + final + "% in your Unit 3 controlled assessment to get an A*"
94
95 elif unit2Done == "n":
96
97 else:
98 print "Sorry. That's not a valid answer."
Run Code Online (Sandbox Code Playgroud)
而错误是:
line 97
else:
^
IndentationError: expected an indented block
Run Code Online (Sandbox Code Playgroud)
我完全不知道为什么我会收到这个错误,但也许你们可以帮助我.围绕它有很多if/else/elif语句,这可能让我感到困惑.非常感谢任何帮助,谢谢!
编辑:将"传递"或代码添加到elif语句只是将相同的错误移动到第95行.
我正在尝试将我的网页拆分为两个垂直列,可以单击这些列以将您带到正确的页面.我已经走到了这一步.
HTML
<!-- Choices -->
<div class="container-fluid">
<div class="row">
<div class="col-md-6 col-xs-12 vertical-center webd">
<h1 class="text-muted text-center">Web Design</h1>
</div>
<div class="col-md-6 col-xs-12 vertical-center circ">
<h1 class="text-muted text-center">Circus</h1>
</div>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
CSS
.vertical-center {
min-height: 100%;
min-height: 100vh;
display: flex;
align-items: center;
}
.webd {
background-image: url('webd.jpg');
}
.circ {
background-image: url(circ.JPG);
}
Run Code Online (Sandbox Code Playgroud)
我的问题是,无论我把text-center课程放在哪里.我<h1>在页面上保持左对齐.有人可以帮忙吗?