Html 当我缩放页面时,文本彼此重叠
我试图为作业制作一个文件夹,当我试图缩小页面窗口时,文本将重叠,使其变得凌乱。我曾经用min width解决过这个问题,但这次似乎无法解决 我无法理解为什么它一直这么做,我对HTML/CSS相当“陌生”,缺乏解决这个问题的经验,如果有人能帮我解决这个问题,我将不胜感激 谢谢 HTMLHtml 当我缩放页面时,文本彼此重叠,html,css,Html,Css,我试图为作业制作一个文件夹,当我试图缩小页面窗口时,文本将重叠,使其变得凌乱。我曾经用min width解决过这个问题,但这次似乎无法解决 我无法理解为什么它一直这么做,我对HTML/CSS相当“陌生”,缺乏解决这个问题的经验,如果有人能帮我解决这个问题,我将不胜感激 谢谢 HTML 在这里,只需替换下面的HTML和CSS代码-请参阅我的注释以了解更改的代码 CSS HTML 持续专业发展投资组合 阿什利·坦纳·莫特尔 页脚详细信息 还建议您阅读本教程,以及youtube上的一些关
在这里,只需替换下面的HTML和CSS代码-请参阅我的注释以了解更改的代码 CSS HTML
持续专业发展投资组合
阿什利·坦纳·莫特尔
页脚详细信息
还建议您阅读本教程,以及youtube上的一些关于HTML和CSS的免费教程,因为我可以在您的CSS和HTML中看到许多基本问题。:) 在这里,只需替换下面的HTML和CSS代码-请参阅我的注释以了解更改的代码 CSS HTML
持续专业发展投资组合
阿什利·坦纳·莫特尔
页脚详细信息
还建议您阅读本教程,以及youtube上的一些关于HTML和CSS的免费教程,因为我可以在您的CSS和HTML中看到许多基本问题。:) +1,&如果您为所做的某些更改添加了简要说明,这可能会对OP有所帮助,您可以在代码中或答案正文中添加注释。谢谢,我一定会检查。+1,&如果您为所做的某些更改添加简要说明,这可能会对OP有所帮助,你可以在代码或答案的正文中添加注释。谢谢,我一定会查出来的。
<head>
<title>CPD Portfolio - Home</title>
<meta charset="UTF-8">
<meta name="description" content="CPD Portfolio">
<meta name="author" content="Ashley Tanner-Mortell">
<meta name="viewport" content="width=device-width, inital=scale=1">
<link rel="stylesheet" href="stylesheet.css">
</head>
<body>
<ul>
<li><a class="active" href="home_page.html">Home</a></li>
<li><a href="university.html">University</a></li>
<li><a href="sports.html">Sports</a></li>
<li><a href="student_mentor.html">Student Mentor</a></li>
</ul>
<div id="gradient">
<div class="container">
<img src="images/ntu1.jpg" style="width:100%; height:600px; object-fit:cover; border-style: solid; text-align: center;">
<div class="centered" style="top:15%">CPD Portfolio</div>
<div class="centered" style="top:20%;">_______________</div>
<div class="centered" style="top:30%; font-size:6vh;">Ashley Tanner-Mortell</div>
</div>
</div>
</body>
<footer>
<p>Footer Details</p>
</footer>
</html>
body,html{
margin: 0;
min-width:500px;
}
footer {
float: left;
background-color: grey;
padding: 0;
width: 100%;
text-align: center;
color: white;
}
ul {
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
background-image: linear-gradient(to right, silver, lightgrey);
}
li {
list-style-type: none;
float: left;
}
li a {
list-style-type: none;
display: block;
color: white;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
li a:hover:not(.active) {
list-style-type: none;
background-color: #E1E1DC;
}
.active {
background-color: #00628B;
}
.container {
margin: 0;
color: white;
font-size: 8vh; /*The vh is viewported by the height, use this for the scaling of text.*/
}
.centered {
position: absolute;
top: 10%;
left: 50%;
transform: translate(-50%, -50%);
}
#gradient {
height: 1300px;
background-color: grey; /* For browsers that do not support gradients */
background-image: linear-gradient(to right, silver, white); /* Standard syntax (must be last) */
}
.box1, .box2{
border-style: solid;
border-width: 1px;
background-color: #F5F5F5;
}
.box1{
float: left;
width: 44vw;
height: 400px;
padding: 1vw;
margin: 1vw;
}
.box2{
float: left;
width: 44vw;
height: 400px;
padding: 1vw;
margin: 1vw;
}
.box3{
float: center;
width: 90%;
}
body,html{
margin: 0;
min-width:500px;
}
footer {
float: left;
background-color: grey;
padding: 0;
width: 100%;
text-align: center;
color: white;
}
ul {
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
background-image: linear-gradient(to right, silver, lightgrey);
}
li {
list-style-type: none;
float: left;
}
li a {
list-style-type: none;
display: block;
color: white;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
li a:hover:not(.active) {
list-style-type: none;
background-color: #E1E1DC;
}
.active {
background-color: #00628B;
}
.container {
margin: 0;
color: white;
font-size: 8vh; /*The vh is viewported by the height, use this for the scaling of text.*/
}
.centered {
position: absolute;
top: 10px;
left: 0;
right:0;
/* transform: translate(-50%, -50%); */
}
#gradient {
height: 1300px;
background-color: grey; /* For browsers that do not support gradients */
background-image: linear-gradient(to right, silver, white); /* Standard syntax (must be last) */
}
.box1, .box2{
border-style: solid;
border-width: 1px;
background-color: #F5F5F5;
}
.box1{
float: left;
width: 44vw;
height: 400px;
padding: 1vw;
margin: 1vw;
}
.box2{
float: left;
width: 44vw;
height: 400px;
padding: 1vw;
margin: 1vw;
}
.box3{
float: center;
width: 90%;
}
/* added css for portfolio section */
.portfolioSection{
padding-top: 100px;
text-align: center
}
/* added css for portfolio heading */
.portfolioHead{
border-bottom:1px solid #000;
display: inline-block;
}
<ul>
<li><a class="active" href="home_page.html">Home</a></li>
<li><a href="university.html">University</a></li>
<li><a href="sports.html">Sports</a></li>
<li><a href="student_mentor.html">Student Mentor</a></li>
</ul>
<div id="gradient">
<div class="container">
<img src="images/ntu1.jpg" style="width:100%; height:600px; object-fit:cover; border-style: solid; text-align: center;">
<!-- wrapped your divisions with parent devision for better control through out screens -->
<div class="centered portfolioSection">
<!-- added class to control heading styles -->
<div class="portfolioHead">CPD Portfolio</div>
<div style="font-size:6vh;">Ashley Tanner-Mortell</div>
</div>
</div>
</div>
</body>
<footer>
<p>Footer Details</p>
</footer>