- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在尝试构建一个响应式网站,我想知道我是应该使用设备工具栏来查看更新,还是只是增加或减少视口(viewport)宽度,如下所示:
一切顺利,至少我一开始是这么想的,当时我将视口(viewport)的宽度减小到与之前的宽度相同(我用于设备工具栏的宽度是 320px
) 我发现文本折叠了我不知道为什么,但我认为那是因为我没有指定精确的高度,是真的吗?
当我选择一个指定的设备,例如 iPhone X 时,发生了一些崩溃,所以我不知道我的解决方案是否可行,但我认为我应该添加一个具有精确宽度和高度的媒体查询该设备的尺寸,因此它将成为该特定设备的指定设计,但我认为使用该解决方案我最终会遇到大量媒体查询,因此我认为这不是最佳解决方案。
抱歉,如果这看起来很愚蠢,但我是初学者,我正在尽最大努力发展我的技能,所以在此先感谢您的回复
这是我的代码:
HTML:
<div class="header-box">
<ul class="main-nav">
<li class="main-nav__items"><a class="main-nav__link" href="#">About</a></li>
<li class="main-nav__items"><a class="main-nav__link" href="#">Projects</a></li>
<li class="main-nav__items"><a class="main-nav__link" href="#">Contact</a></li>
</ul>
<div class="text">
<h1 class="big-heading"><span class="name">M.Amine Elwere</span> Front-end <br /> Web developer</h1>
</div>
<div class="vector-1">
<div class="box">
<img src="../vector/cloud.png" data-aos="fade-right" data-aos-duration="4000" class="img-dialogue" alt="">
</div>
<img src="../vector/Png for the web/header minou.png" data-aos="fade-up" class="img-header" alt="">
</div>
</div>
<!--trapezoid-->
<img src="../vector/murva 1.1.png" class="img-murv" data-aos="zoom-out-up" alt="">
<img src="../vector/Png for the web/header minou2.png" class="img-back" data-aos-duration="1500" data-aos="zoom-in" alt="">
<div class="trapezoid">
<div class="circle"></div>
<div class="text-2">
<span data-aos="fade-right" data-aos-duration="1000" class="saluation">Hi I'am Murva 1.0</span> <span data-aos="fade-down" data-aos-duration="2000" class="welcome">Welcome</span>
</div>
</div>
<!--Murva 1.0-->
<img src="../vector/murva 1.1.png" class="img-m" alt="">
<p class="leading"><span data-aos="fade-right" data-aos-duration="1500" class="sub-leading__1">I think you got some questions.</span> <span data-aos="fade-left" data-aos-duration="2000" class="sub-leading__2"> I knew that, Ok let me just walk you through this lovely website </span>
<p class="leading"><span data-aos="fade-right" data-aos-duration="1500" class="sub-leading__1">I think you got some questions.</span> <span data-aos="fade-left" data-aos-duration="2000" class="sub-leading__2"> I knew that, Ok let me just walk you through this lovely website </span>
<span class="sub-leading__3" data-aos="fade-right" data-aos-duration="1600" >and I will answer all of them on the</span><span class="sub-leading__4" data-aos="fade-right" data-aos-duration="2000" >ROAD...</span>
</p>
<!--Murva 0.0-->
<img src="../vector/Mino-1 hiding.png" class="img-m1" data-aos="fade-left" alt="">
<p class="leading-2">
<span class="sub-lea__1" data-aos="fade-right" data-aos-duration="1500">Hi</span>
<span class="sub-lea__2" data-aos="fade-left" data-aos-duration="2000">I’m Murva 0.0</span>
<span class="sub-lea__3" data-aos="fade-left" data-aos-duration="3000">sorry I saluate you in the header but i didn’t introduce my self</span><br />
<span class="sub-lea__4" data-aos="fade-up" data-aos-duration="2000" >I’m the first version in the <span class="word-0">Murva</span> family and who
told you <span class="word-1">“welcome”</span> above,that was my little brother,
ahh sorry I interrupt your walk I just wanted to say Hi So </span>
<span class="sub-lea__5" data-aos="zoom-in-up" data-aos-duration="2000">We’ ll catch up later.</span>
</p>
CSS:
* {
margin: 0;
padding: 0;
}
body {
background-color: #ffffcc;
overflow-x: hidden;
height: 10000px;
}
@keyframes moveInLeft {
0% {
opacity: 0;
transform: translate(-100px);
}
,
80% {
transform: translate(20px);
}
100% {
opacity: 1;
transform: translate(0px);
}
}
@keyframes moveInRight {
0% {
opacity: 0;
transform: translateX(200px);
}
,
80% {
transform: translateX(-100px);
}
,
100% {
opacity: 1;
transform: translateX(0px);
}
}
@media (max-width:319px) {
.header-box {
width: 100vw;
height: 90vh;
background-color: #33cccc;
-webkit-clip-path: polygon(0 0, 100% 0%, 100% 76%, 0% 100%);
clip-path: polygon(0 0, 100% 0%, 100% 76%, 0% 100%);
position: relative;
}
.main-nav {
display: flex;
list-style-type: none;
justify-content: space-around;
width: 100vw;
text-align: right;
}
.main-nav__link {
text-decoration: none;
font-family: 'Roboto', sans-serif;
font-weight: bold;
color: #ffffcc;
}
.text {
font-family: Roboto;
font-weight: bold;
font-size: 20px;
color: #ffffcc;
height: 50vh;
display: flex;
align-items: center;
justify-content: center;
align-content: center;
}
.name {
font-size: 1rem;
display: block;
animation-name: moveInLeft;
animation-duration: 2s;
}
.vector-1 {
position: relative;
height: 37vh;
}
.img-dialogue {
width: 60%;
position: absolute;
left: 20%;
bottom: 57%;
z-index: -1;
}
.dialogue {
font-family: Roboto;
color: #33cccc;
position: absolute;
top: 24px;
left: 55px;
display: inline-block;
}
.img-header {
width: 60%;
position: absolute;
bottom: 9px;
}
.saluation {
position: absolute;
bottom: 50vh;
font-family: Roboto;
font-size: 1.7rem;
left: 30vw;
}
.welcome {
position: absolute;
bottom: 31vh;
font-size: 15vw;
font-family: Roboto;
font-weight: bold;
left: 3vw;
}
.img-murv {
position: absolute;
z-index: 1;
width: 20.31rem;
right: -2.44rem;
}
.img-back {
position: absolute;
z-index: -1;
width: 36vw;
height: 64vh;
}
} /* END OF MAX-WIDTH 319PX */
/* @media (max-width: 375px) {
.img-dialogue {
width: 50%;
position: absolute;
left: 20%;
bottom: 78%;
z-index: -1;
}
.sub-lea-3{
top: 88px;
}
} */
@media (min-width:320px) {
.header-box {
width: 100vw;
height: 90vh;
background-color: #33cccc;
-webkit-clip-path: polygon(0 0, 100% 0%, 100% 76%, 0% 100%);
clip-path: polygon(0 0, 100% 0%, 100% 76%, 0% 100%);
position: relative;
}
.main-nav {
display: flex;
list-style-type: none;
justify-content: space-around;
width: 100vw;
text-align: right;
}
.main-nav__link {
text-decoration: none;
font-family: 'Roboto', sans-serif;
font-weight: bold;
color: #ffffcc;
}
.text {
font-family: Roboto;
font-weight: bold;
font-size: 20px;
color: #ffffcc;
height: 50vh;
display: flex;
align-items: center;
justify-content: center;
align-content: center;
}
.name {
font-size: 1rem;
display: block;
animation-name: moveInLeft;
animation-duration: 2s;
}
.vector-1 {
position: relative;
height: 37vh;
}
.img-dialogue {
width: 60%;
position: absolute;
left: 20%;
bottom: 57%;
z-index: -1;
}
.dialogue {
font-family: Roboto;
color: #33cccc;
position: absolute;
top: 24px;
left: 55px;
display: inline-block;
}
.img-header {
width: 60%;
position: absolute;
bottom: 9px;
}
.trapezoid {
clip-path: polygon(0 32%, 100% 0, 100% 100%, 0 70%);
background-color: #33cccc;
width: 100%;
height: 50vh;
position: relative;
max-width: 100vw;
}
.circle {
clip-path: circle(50% at 50% 50%);
background-color: #ffffcc;
width: 160px;
height: 160px;
position: absolute;
top: 65px;
right: 3px;
}
.img-murv {
position: absolute;
z-index: 1;
width: 7.31rem;
right: 1.56rem;
}
.text-2 {
color: #ffffcc;
}
.saluation {
position: absolute;
bottom: 28vh;
font-family: Roboto;
font-size: 1rem;
left: 5vw;
}
.welcome {
position: absolute;
bottom: 23vh;
font-size: 10vw;
font-family: Roboto;
font-weight: bold;
left: 3vw;
}
.img-murv {
position: absolute;
z-index: 1;
width: 12.31rem;
right: -0.44rem;
}
.img-back {
position: absolute;
z-index: -1;
width: 35vw;
}
.img-m {
width: 40vw;
transform: rotateZ(41deg) translateX(-75px);
}
.leading {
position: relative;
font-family: Roboto;
font-weight: bold;
color: #33cccc;
}
.sub-leading__1 {
position: absolute;
top: -149px;
left: 80px;
font-size: 0.81rem;
}
.sub-leading__2 {
position: absolute;
top: -22vh;
font-size: 0.9rem;
left: 30vw;
}
.sub-leading__3 {
position: absolute;
top: -14vh;
left: 18vw;
}
.sub-leading__4 {
position: absolute;
top: -10vh;
left: 34vw;
font-size: 48px;
}
.img-m1 {
position: absolute;
right: 0;
width: 25%;
}
.leading-2{
position: relative;
font-family: Roboto;
color: #33cccc;
}
.sub-lea__1{
font-size: 8rem;
font-weight: bold;
}
.sub-lea__2 {
position: absolute;
top: 46px;
font-weight: bold;
}
.sub-lea__3{
position: absolute;
top: 74px;
left: 130px;
right: 46px;
font-weight: bold;
font-size: 12px;
}
.sub-lea__4 {
position: absolute;
font-weight: bold;
font-size: 14px;
bottom: -68px;
margin-left: 20px;
}
.word-0{
font-size: 2rem;
}
.word-1{
font-size: 1.12rem;
}
.sub-lea__5 {
position: absolute;
bottom: -119px;
left: 75px;
font-weight: bold;
font-size: 23px;
}
}
@media (min-width:320px) and (min-height:578px) {
.welcome {
bottom: 21vh;
left: 3vw;
}
.img-back {
width: 37vw;
}
.saluation {
bottom: 28vh;
left: 20vw;
font-size: 12px;
}
}
@media (max-width: 375px) {
.img-dialogue {
width: 50%;
position: absolute;
left: 20%;
bottom: 78%;
z-index: -1;
}
.img-back {
width: 43vw;
}
.sub-lea__3{
margin-right: 35px;
}
.sub-lea__4{
margin-left: 20px;
margin-right: 20px;
bottom:-80px
}
}/*end of 375px*/
@media (max-width: 375px) and (max-height:578px) {
.img-back {
width: 30vw;
}
}
@media (max-width:375px) and (min-width:578px) {
.saluation {
bottom: 26vh;
left: 20vw;
}
.welcome {
bottom: 21vh;
left: 3vw;
}
.img-back {
width: 37vw;
}
}
@media (min-width:425px) {
.img-dialogue {
width: 31%;
position: absolute;
left: 20%;
bottom: 70%;
z-index: -1;
}
.img-header {
width: 40%;
position: absolute;
bottom: 9px;
}
.img-back {
width: 38vw;
}
.saluation {
bottom: 26vh;
left: 20vw;
}
.welcome {
bottom: 20vh;
}
.sub-lea__3{
margin-right: 53px;
}
.sub-lea__4 {
margin-right: 34px;
}
.sub-leading__1 {
margin-left: 25px;
}
}
@media (min-width:425px) and (max-height:578px) {
.img-back {
width: 30vw;
}
}
@media (min-width:768px) {
.main-nav {
display: flex;
list-style-type: none;
justify-content: flex-end;
width: 100vw;
text-align: right;
}
.main-nav__items {
margin-right: 2rem;
margin-top: 1rem;
}
.img-header {
width: 30%;
}
.img-dialogue {
width: 20%;
left: 10%;
}
.text {
font-size: 2rem;
}
.trapezoid {
clip-path: polygon(0 32%, 100% 0, 100% 100%, 0 70%);
background-color: #33cccc;
width: 100%;
height: 83vh;
position: relative;
max-width: 100vw;
}
.circle {
clip-path: circle(50% at 50% 50%);
background-color: #ffffcc;
width: 200px;
height: 200px;
position: absolute;
top: 171px;
right: 3px;
}
.saluation {
position: absolute;
bottom: 50vh;
font-family: Roboto;
font-size: 1.7rem;
left: 30vw;
}
.welcome {
position: absolute;
bottom: 31vh;
font-size: 15vw;
font-family: Roboto;
font-weight: bold;
left: 3vw;
}
.img-murv {
position: absolute;
z-index: 1;
width: 20.31rem;
right: -2.44rem;
}
.img-back {
position: absolute;
z-index: -1;
width: 25vw;
height: 57vh;
}
.img-m {
transform: rotateZ(41deg) translateX(-167px);
}
.sub-leading__1 {
top: -330px;
left: 218px;
font-size: 23px;
}
.sub-leading__2 {
top: -52vh;
font-size: 21px;
left: 21vw;
font-weight: 100;
}
}
@media (min-width:768px) and (min-height:1024px) {
.img-dialogue {
width: 36%;
left: 21%;
}
.main-nav {
font-size: 1.4rem;
}
.img-header {
width: 49%;
}
.saluation {
bottom: 41vh;
left: 30vw;
}
.img-murv {
width: 25.31rem;
right: -5.44rem;
}
.circle {
top: 299px;
right: 13px;
}
.img-back {
width: 33vw;
height: 50vh;
}
}
@media (min-width:768px) and(min-height:578px) {
.img-back {
width: 32vw;
height: 55vh;
}
}
最佳答案
包你<p>
包含 <div>
中文本的元素与类容器并给它一个display: flex;
属性(property)。这应该有所帮助。
编辑:我还建议在您的设计中使用网格系统。类似于 Flexbox或 CSS Grid , 或 both .这将有助于定位您在网站上的文本。它将避免您目前遇到的许多令人头疼的问题。
至于媒体查询,我不会担心指定 max-height
在查询中。只是宽度。我对响应式设计的方法是使用基于设备屏幕尺寸的分辨率(就像你对 iPhone X 所说的那样),然后修复中间完全损坏的任何东西。查看像 Bootstrap 这样的框架也可能对您有所帮助,因为它被设计成响应式的,可以让你避免一些来自 vanilla html/css 的头痛。
关于html - 我应该使用设备工具栏还是增加和减少视口(viewport)宽度?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55399858/
iphone设备UDID、iphone设备ID和iphone设备Token之间有什么区别? 通常,当我们使用苹果推送通知服务时,会使用 iPhone 设备 token 。 但我的目标只是识别唯一的 i
我们使用 firebase 从服务器向 Android 和 IOS 设备发送通知,并且我们使用旧版 FCM 发送通知。但是当我们的应用程序在后台时,通知由系统本身处理,因此我们无法通过应用程序处理它。
在 Google 上搜索后,我发现人们说只能通过“MFi 程序”将 iOS 设备与非 iOS 设备连接起来。这是真的吗? 我的项目主要集中于直接通过蓝牙与Arduino设备发送和接收信息。 iOS和非
所以我有一个通用应用程序,我正在设置 UIScrollView 的内容大小。显然,iPhone 和 iPad 上的内容大小会有所不同。如何为 iPad 设置某种尺寸,为 iPhone 和 iPod t
问题:如何在 pod 中使用连接到主机的原始设备作为 block 设备。 我尝试使用类型为“BlockDevice”的“hostPath” volumes: - my-data: hostPath
Implemented GCKDeviceScannerListener Singleton Class on ViewController, however its delegate methods
我有一个 (PhoneGap) 应用程序,它将成功获得 Passbook 通行证,并且还将成功接收与 Passbook 分开的推送通知(当伪造设备 ID 时)。 我遇到的问题是发送给注册设备的设备 I
我正在尝试找到一种方法,通过我目前正在使用的 iOS 应用程序访问我的信标的电池电量。我正在使用 Kontakt 的 iBeacon 设备。我浏览了 Estimote iOS SDK,他们提供了一种实
我正在努力让 CUDA 应用程序也能监控 GPU 的核心温度。可通过 NVAPI 访问该信息。 问题是我想确保在运行代码时监控的是同一个 GPU。 但是,似乎有信息表明我从 NvAPI_EnumPhy
从沙箱模式到生产模式,设备 token 有何不同? 我认为我已将一些设备 token 锁定为生产模式,并且无法将它们从开发中插入。 关于如何检查有什么想法吗? 最佳答案 当您使用开发证书构建应用程序时
目录 /run/user/1000/gvfs 和 ~/.gvfs 分别是空的和不存在的。我的图形文件管理器 (Thunar) 能够检测和访问设备的内部和外部存储器。 命令 gvfs-mount -l
我有一个 Android 平板电脑,它有一个迷你 USB 端口和一个 USB 端口,我想编写一个与 USB key 通信的应用程序。我写了一个demo来找出U盘,但是没有任何反应。 令我不安的是,如果
我们将 PHP 版本从 5.4.25 更改为 5.4.45,并在服务器上安装了 MS SQL 驱动程序。在更改服务器之前,一切正常,但在更改服务器之后,我遇到了 Web 服务问题。我们的身份验证 So
我想知道是否有人使用此 API 在 Android 设备上同时从 2 个后置摄像头捕获图像或视频:https://source.android.com/docs/core/camera/concurr
我正在为客户构建一个物联网解决方案,网络管理员坚持要求设备仅通过访客网络进行连接,该网络有一个强制门户,其中的服务条款必须通过按下 UI 按钮来接受,然后才能获得外部互联网访问。到目前为止,我见过的大
我无法弄清楚这里的格式规则..在我的示例中,代码行太多,无法为每行添加 4 个空格,因此这里是我需要帮助的代码的链接 http://nitemsg.blogspot.com/2011/01/heres
如果我在我的设备上接受推送通知,并且不保存设备 token ,那么我如何在自定义 View 中查看设备 token 或恢复警报 View ? 我删除了应用程序并重新安装,但看不到设备 token 警报
我试图找出在尝试并行比较和复制设备 block 与 pthreads 时我做错了什么。看起来我正在脱离同步并且比较阶段无法正常工作。任何帮助将不胜感激 #ifndef __dbg_h__ #defin
我刚刚写完所有这些内容,但这个红色的小栏告诉我我不能发布图片或两个以上的链接。因此,如果您可以引用 this Imgur album , 那简直太好了。谢谢。 我在这里相对较新,甚至对 android
我需要启用 mysql 常规日志并将其通过 nsf 移动到我系统中的另一个驱动器/设备! 所以,我在 my.cnf 中启用了它: general_log = 1 general_log_fi
我是一名优秀的程序员,十分优秀!