- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在我的网站首页上以我的名义编写了一个动画代码。我为单个字母使用了不同的 h1 block ,全名位于 div block 中。我希望在将鼠标悬停在名字的字母上时,它们会稍微抬起并稍微向上移动,但我遇到了一个问题,即在小屏幕上而不是整个姓氏上,如果我们使用更小的屏幕,一个字母就会下降一个又一个字母,我希望整个姓氏立即永远消失。
我试过将字母放在同一个 div block 中,但情况是一样的。我希望在小屏幕上字母不应该一个接一个地向下显示,而是完整的姓氏一次显示。
.MainText {
font-size: 50px;
left: 18%;
top: 25%;
font-family: "Arial Black";
position: fixed;
}
.hoverr {
position: relative;
top: 0;
transition: top ease 1s;
float: left;
clear: none;
}
.hoverr:hover {
top: -30px;
transform: scale(1.15);
text-shadow: rgb(121, 121, 121);
}
<div class="MainText">
<!--first name-->
<div>
<h1 class="hoverr ">A</h1>
<h1 class="hoverr">B</h1>
<h1 class="hoverr">H</h1>
<h1 class="hoverr">I</h1>
<h1 class="hoverr">N</h1>
<h1 class="hoverr">N</h1>
</div>
<!--blank space for seprating first name and last name-->
<h1 class="hoverr"> </h1>
<!--last name-->
<div>
<h1 class="hoverr">K</h1>
<h1 class="hoverr">R</h1>
<h1 class="hoverr">I</h1>
<h1 class="hoverr">S</h1>
<h1 class="hoverr">H</h1>
<h1 class="hoverr">N</h1>
</div>
</div>
最佳答案
您可以使用一个 h1 作为您的名字,最后使用 vw 来设置您的字体大小:
示例清理 html 和一些你的 css
.MainText {
font-size: calc(5vw);
left: 18%;
top: 25%;
font-family: "Arial Black";
position: fixed;
}
.hoverr {
display:inline-block;
transition: transform ease 1s;
}
.hoverr:hover {
transform: scale(1.15) translatey(-3vw);
text-shadow: rgb(121, 121, 121);
}
<div class="MainText">
<h1>
<!--first name-->
<span class="hoverr ">A</span>
<span class="hoverr">B</span>
<span class="hoverr">H</span>
<span class="hoverr">I</span>
<span class="hoverr">N</span>
<span class="hoverr">N</span>
<!--blank space for seprating first name and last name-->
<br>
<!--last name-->
<span class="hoverr">K</span>
<span class="hoverr">R</span>
<span class="hoverr">I</span>
<span class="hoverr">S</span>
<span class="hoverr">H</span>
<span class="hoverr">N</span>
</h1>
</div>
如果该页面上没有其他内容,并且您希望在中间显示您的名字,flex 可以轻松帮助您:
/* centers body in the window if smaller than window */
html {
min-height: 100vh;
display: flex;
}
body {
margin: auto;
}
/* end page centering */
.MainText {
font-size: calc(5vw);
font-family: "Arial Black";
}
.hoverr {
display: inline-block;
transition: transform ease 1s;
}
.hoverr:hover {
transform: scale(1.15) translatey(-3vw);
text-shadow: rgb(121, 121, 121);
}
<div class="MainText">
<h1>
<!--first name-->
<span class="hoverr ">A</span>
<span class="hoverr">B</span>
<span class="hoverr">H</span>
<span class="hoverr">I</span>
<span class="hoverr">N</span>
<span class="hoverr">N</span>
<!--blank space for seprating first name and last name-->
<br>
<!--last name-->
<span class="hoverr">K</span>
<span class="hoverr">R</span>
<span class="hoverr">I</span>
<span class="hoverr">S</span>
<span class="hoverr">H</span>
<span class="hoverr">N</span>
</h1>
</div>
关于javascript - 我在首页上的名字没有响应,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57361173/
给定默认路由,以下任一 URL 将导航到 Home Controller 的 Index 方法: 1. http://localhost 2. http://localhost/Home/Inde
可以在“设置”>“阅读”下找到 WordPress 阅读设置。 我将 WordPress 的“首页显示”选项设置为“静态首页”。 我的“首页”设置为“关于”。 我正在尝试为注销和登录用户设置不同的首页
我正在尝试禁用 Wordpress 首页上的插件,以使其更轻一些。我只想在显示首页时禁用它。 我在 wp-content/mu-plugins/中放置了这个工作代码它会禁用除指定/子页面/之外的所有页
有没有一种方法可以使首页包含 2 个 View ,而不使用 Drupal 6.x 中的面板模块? 谢谢 最佳答案 如果您不想使用面板,您可以将 2 个 View 创建为 block (就像侧边栏等一样
已关闭。此问题不符合Stack Overflow guidelines 。目前不接受答案。 这个问题似乎不是关于 a specific programming problem, a software
我尝试管理基于 Plone 的网站 www.capital-tennis.org 上的内容。我对 Plone 本身几乎一无所知。 我想向网站的首页(主页面)添加 2 个 portlet,一个在左侧(在
如图所示,底部有 3 个 Controller ,分别是(HomeTableViewController、NavigationViewController 和 NewsViewController)
我开始在Windows上使用pentaho BI Server 5.2,并尝试通过本教程使用mysql配置进行安装: https://anonymousbi.wordpress.com/2013/12
我的首页(也就是发布帖子的页面)上的链接是红色的,悬停时它们会变成白色。但是在我的 STATIC 页面上,我希望链接在悬停时为白色和红色,我该怎么做? Tumblr 允许将 html 添加到您的静态页
我想创建一个网站 ala failblog.org,用户可以在其中提交内容并对内容进行投票 我想做的是 一种。向节点/文章添加一个字段,称为“front_page_at (date_time)” 湾。
注意:不能使用 Javascript 或 iframe。事实上,我不能相信客户端浏览器可以做任何事情,除了最基本的事情。 我正在将遗留的 PHP4 应用程序重建为 MVC 应用程序,目前我的大部分研究
我在这里不知所措。我觉得我已经尝试了所有的方法,并使用了其他帖子/教程中解释的确切方法。我知道您需要使用光标并设置第一个和最后一个可见文档,以便在向前移动的情况下从最后一个文档开始,在向后移动的情况下
我是一名优秀的程序员,十分优秀!