gpt4 book ai didi

html - 窗口调整大小时隐藏文本

转载 作者:行者123 更新时间:2023-11-28 15:15:41 26 4
gpt4 key购买 nike

我正在基于提供的模板为类构建一个网站,并且我正在努力制作它以便我的文本随着窗口大小的调整而移动(现在,调整窗口大小会遮盖文本和相关按钮).

理想情况下,我希望页面以这样一种方式锚定,即焦点保持在文本/按钮上 - 并且通过扩展,图像的右下角 - 随着窗口的大小调整。

这是我的 HTML:

<!DOCTYPE html>
<html lang="en">
<head>

<meta name="viewport" content="width=device-width, inital-scale=1.0">
<!-- This tells mobile devices not to zoom out the page, start with scale=1 -->
<link rel="stylesheet", type="text/css", href="Vendors/css/normalize.css">
<link rel="stylesheet", type="text/css", href="Vendors/css/grid.css">
<link rel="stylesheet", type="text/css", href="Vendors/css/ionicons.min.css">
<link rel="stylesheet", type="text/css", href="Resources/css/style.css">
<link rel="stylesheet", type="text/css", href="Resources/css/queries.css">
<link href='http://fonts.googleapis.com/css?family=Lato:100,300,400,300italic' rel='stylesheet' type='text/css'>

<title>Whitetail Acres Tree Farm</title>
</head>
<body>
<header>
<nav>
<div class="row">
<img src="Resources/img/logo-white.png" alt="Omnifood logo" class="logo">
<ul class="main-nav">
<li><a href="#features">Food Delivery</a></li>
<li><a href="#meals">How it Works</a></li>
<li><a href="#steps">Our Cities</a></li>
<li><a href="#cities">Sign up</a></li>
</ul>
<a class="mobile-nav-icon js--nav-icon"><i class="ion-navicon-round"></i></a>
</div>
</nav>
<div class="hero-text-box">
<h1>Schedule <br> Your Visit!</h1>
<a class="btn btn-full js--scroll-to-plans" href="#">I'm hungry</a>
<a class="btn btn-ghost js--scroll-to-start" href="#">Show me more</a>
</div>
</header>

这是我的 CSS:

/* Universal Reset*/
*{
margin: 0;
padding: 0;
box-sizing: border-box;
}

html
{
background-color: #ffffff;
color: #555;
font-family: 'Lato', 'Arial', sans-serif;
font-size: 20px;
font-weight: 300;
text-rendering: optimizeLegibility;
}

.clearfix {zoom: 1}
.clearfix:after {
content: '.';
clear: both;
display: block;
height: 0;
visibility: hidden;
}

header{
background-image: url(img/hero.jpg);
background-size: cover;
background-position:bottom, right;
height: 100vh;
background-attachment:inherit;
}

.hero-text-box{
position: absolute;
width:1080px;
top:80%;
left:55%;
text-align: right;
transform: translate(-50%, -50%);
}

.row{
max-width: 1140px;
margin:0 auto;
}

section{
padding: 80px 0;
}

.box{

padding: 1%;

最佳答案

看起来您还没有为行定义宽度。尝试类似的东西:

.row{
max-width: 1140px;
width: 100%;
margin:0 auto;
}

关于html - 窗口调整大小时隐藏文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47272622/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com