[英]How to change text size in a web page?
I am new to building Web pages.我是构建 Web 页面的新手。 Just for training, I made a really simple site but, I don't understand why I can't change text size.只是为了培训,我做了一个非常简单的网站,但是我不明白为什么我不能改变文字大小。
If I delete background image code works, but I can't do that like this:如果我删除背景图像代码有效,但我不能这样做:
<head>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css">
<script src="jquery/jquery.min.js"></script>
<script>
$(document).ready(function() {
$("button").click(function() {
$("h1, p").addClass("dark");
$("div").addClass("important");
});
});
</script>
<style>
body,
html {
height: 100%;
}
#grad1 {
background-image: url("https://mdbootstrap.com/img/Photos/Horizontal/Nature/full page/img(20).jpg");
height: 100%;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
p {
font-size: 28px;
}
.important {
font-weight: bold;
font-size: xx-large;
}
.dark {
color: dark;
}
</style>
</head>
<body>
<div id="grad1">
<div class="container">
<h1 align="center">Dzīves jēga</h1><br><br>
<p align="center"><dfn>“Dzīves jēga nav gaidīt, kad beigsies
negaiss..
bet gan iemācīties dejot lietū!”</dfn></p>
<button type="button" class="btn btn-lg btn-info">Izmaiņas ir
neizbēgamas</button>
</div>
</div>
</body>
I just cant figure this out siting here for 2 days.我只是想不通这个选址在这里 2 天。
The issue was because you did not have the closing bracket for #grad1
style.问题是因为您没有#grad1
样式的右括号。
Change style to -将样式更改为 -
#grad1 {
background-image: url("https://mdbootstrap.com/img/Photos/Horizontal/Nature/full page/img(20).jpg");
height: 100%;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.