定位到相同页面部分的锚点移动得太低(Anchor tag to same page section moves too low)
我想要使用锚标记从主页的顶部移动到主页的较低部分。 主页的下半部分是一个div,就像另一个页面一样,只是它在同一页面上更低。 它被称为find-vegan-products-page,并有一个表单。 该表单的margin-top为100px,因此它不在find-vegan-products-page表单的顶部。 我希望锚点将用户带到find-vegan-products-page的顶部,显示100px的边距(因此表单不在页面的顶部。但它会转到表单的顶部。我认为这是因为表单上面没有任何内容可以导致100px的上边距向下推送表单。这是我的意思的照片:
这是我的代码:
HTML:
<body> <div style="margin-bottom: 100px;" class="full_size dimmed"> <div style="position:fixed; z-index: -1;"> <video style="position:fixed;" autoplay loop poster="assets/images/home_page/polina.jpg" id="bgvid"> <!--<source src="polina.webm" type="video/webm">--> <source src="assets/videos/polina.mp4" type="video/mp4"> </video> </div> <div class="header dim"> <a href="http://www.w3schools.com" ><h5 id="app-name" class="nav-item clickable white-text medium-text left-text">THE VEGAN REPOSITORY</h5></a> <a href="http://www.w3schools.com" ><h5 (click)="clicked()" id="sign-in-button" class="nav-item clickable brand-colour-text medium-text right-text with-border">SIGN UP FREE</h5></a> <a href="http://www.w3schools.com" ><h5 class="nav-item clickable white-text medium-text right-text">LOGIN</h5></a> <a href="#home_page_footer" ><h5 class="nav-item clickable white-text medium-text right-text" >BLOG</h5></a> <a href="#home_page_footer" ><h5 class="nav-item clickable white-text medium-text right-text" >ABOUT</h5></a> </div> <div id="motto-text" class="vertical-center"> <h5 class="white-text medium-text">THE VEGAN REPOSITORY</h5> <h1 id="main-text" class=" text-center white-text light-text extra-large-text">FIND VEGAN PRODUCTS NEAR YOU</h1> <a id="try-now-button" class="with-border clickable" href="#find-vegan-products-page" ><h5 class=" text-center medium-text">TRY NOW</h5></a> </div> </div> <!-- <div id="googleMap" style="height:500px;"></div> --> <div id="find-vegan-products-page" style="height:900px;"> <div class="form-background"> <form role="form" style="padding: 40px;"> <div class="form-group"> <input type="text" class="form-control input-control" placeholder="Country"> </div> <div class="form-group"> <input type="text" class="form-control" placeholder="City"> </div> <div class="checkbox"> <label><input type="checkbox"> Remember me</label> </div> <button type="submit" class="btn btn-default">Submit</button> </form> </div> </div> </body>
CSS:
.input-control { height: 5rem; width: 49%; display: inline-flex; background-color: transparent; border: none; } .form-background { background: rgba(149, 246, 102, .5); margin: 100px 100px 0px 100px; }
如何获取锚点以移动页面,以便表单顶部和屏幕顶部之间有100px的间隔?
I want to use an anchor tag to move from the top of the home page to a lower part of the home page. The lower part of the home page is a div, that is like another page, only it's lower down on the same page. It is called find-vegan-products-page, and has a form on it. The form has a margin-top of 100px, so that it is not at the very top of the form find-vegan-products-page. I want the anchor to take the user to the top of the find-vegan-products-page, displaying the 100px margin (so the form is not at the very top of the page. But it goes instead to the top of the form. I think this is because the form has nothing above it to cause the 100px top-margin to push the form down. Here are photos of what I mean:
Here's my code:
html:
<body> <div style="margin-bottom: 100px;" class="full_size dimmed"> <div style="position:fixed; z-index: -1;"> <video style="position:fixed;" autoplay loop poster="assets/images/home_page/polina.jpg" id="bgvid"> <!--<source src="polina.webm" type="video/webm">--> <source src="assets/videos/polina.mp4" type="video/mp4"> </video> </div> <div class="header dim"> <a href="http://www.w3schools.com" ><h5 id="app-name" class="nav-item clickable white-text medium-text left-text">THE VEGAN REPOSITORY</h5></a> <a href="http://www.w3schools.com" ><h5 (click)="clicked()" id="sign-in-button" class="nav-item clickable brand-colour-text medium-text right-text with-border">SIGN UP FREE</h5></a> <a href="http://www.w3schools.com" ><h5 class="nav-item clickable white-text medium-text right-text">LOGIN</h5></a> <a href="#home_page_footer" ><h5 class="nav-item clickable white-text medium-text right-text" >BLOG</h5></a> <a href="#home_page_footer" ><h5 class="nav-item clickable white-text medium-text right-text" >ABOUT</h5></a> </div> <div id="motto-text" class="vertical-center"> <h5 class="white-text medium-text">THE VEGAN REPOSITORY</h5> <h1 id="main-text" class=" text-center white-text light-text extra-large-text">FIND VEGAN PRODUCTS NEAR YOU</h1> <a id="try-now-button" class="with-border clickable" href="#find-vegan-products-page" ><h5 class=" text-center medium-text">TRY NOW</h5></a> </div> </div> <!-- <div id="googleMap" style="height:500px;"></div> --> <div id="find-vegan-products-page" style="height:900px;"> <div class="form-background"> <form role="form" style="padding: 40px;"> <div class="form-group"> <input type="text" class="form-control input-control" placeholder="Country"> </div> <div class="form-group"> <input type="text" class="form-control" placeholder="City"> </div> <div class="checkbox"> <label><input type="checkbox"> Remember me</label> </div> <button type="submit" class="btn btn-default">Submit</button> </form> </div> </div> </body>
CSS:
.input-control { height: 5rem; width: 49%; display: inline-flex; background-color: transparent; border: none; } .form-background { background: rgba(149, 246, 102, .5); margin: 100px 100px 0px 100px; }
How do I get the anchor to move the page so that there is a 100px gap between the top of the form and the top of the screen?
原文:https://stackoverflow.com/questions/35053141
最满意答案
通过使用ip套接字作为“代理”,Socat可用于创建网络串行端口。 这是可以用于我们要创建的每个端口的命令:
sudo socat ip:localhost:222 pty,raw,echo=0
Socat can be used for creating a network o serial port by using a ip socket as a "broker". This is the command that can be used for each port that we want to create:
sudo socat ip:localhost:222 pty,raw,echo=0
相关问答
更多-
不一定是答案 但需要这个空间来添加一个例子。 您是否尝试使用Qt函数来确定可用的端口? 这是我用来查找USB串口的函数示例(如果需要,循环使用c ++ 11可以转换回来)... QList
QSerialComs::getUsbSerialPortsList() { QList usbSerialPorts; for (auto serialPortInfo: QSerialPortInfo::availablePorts()) { ... -
您可能希望调整这个来自socat手册页的示例: socat PTY,link=/var/run/ppp,rawer INTERFACE:hdlc0 避免了pppd需要串行设备的问题,因此可能无法在网络设备所代表的同步线路上工作。 socat创建一个PTY来使pppd满意,绑定到网络接口hdlc0,并可以在两个设备之间传输数据。 然后在设备/ var / run / ppp上使用pppd。 在此示例中,接口是同步线(OS将其视为HDLC接口)。 pppd使用(默认情况下)类似HLDC的帧,因此将原始数据从p ...
-
尝试 socat -v /dev/ttyAMA0 tcp-connect:localhost:10001 更多信息,请使用帮助: socat -h try socat -v /dev/ttyAMA0 tcp-connect:localhost:10001 for more, use help: socat -h
-
(我的第一种方法不正确,所以我修改) 我从来没有使用过socat ,但是如果它有-v log.txt选项我有一个可能的解决方案,因为我看到-v选项它也将结果打印到stderr。 我假设您希望将日志文件发送到log.txt,剪切前10行并删除所有\r字符。 在支持进程替换的bash上 ,可以这样做: socat -v ... 2> >(awk 'NR>10 {gsub("\r","");print}'>log.txt) (注意两个>标记之间的空间!!!) 这将创建一个进程,并且>(...)返回一个像/dev ...
-
通过网络桥接串行端口(Bridge Serial-Ports over network)[2022-09-08]
tcp连接的一端需要侦听端口(您启动的第一个端口),第二端连接到端口。 对于第一方做: socat tcp-listen:8080 pty,link=/dev/virtualport0 对于第二方做: socat pty,link=/dev/virtualcom0 tcp:IP-of-other-machine:8080 忘记netcat,你不需要它。 One side of the tcp connection needs to be listening on the port (the first ... -
我用socat工具使用下面的命令实现了串口到以太网的转换。 sudo socat TCP-L:33888 GOPEN:/dev/ttyS1,ispeed=4800,ospeed=4800,b4800,raw,echo=0 I achieved the serial to ethernet conversion using below command with socat tool. sudo socat TCP-L:33888 GOPEN:/dev/ttyS1,ispeed=4800,ospeed=480 ...
-
谢谢您的帮助。 我现在已经解决了,可以很好地沟通。 Socat确实是一个复杂的工具。 这是我的最终设置: sudo socat -U -d -d -d /dev/tty.usbserial,clocal=1,cs8,nonblock=1,ixoff=0,ixon=0,ispeed=9600,ospeed=9600,raw,echo=0,crtscts=0 FILE:tnc-start.hex 'ixon'启用XON / XOFF流量控制,'ixoff'启用发送/停止字符的发送,而有趣的是'echo'不会打 ...
-
在Vagrant和VirtualBox环境中使用`socat`进行多播(Multicasting with `socat` in Vagrant & VirtualBox Env)[2023-08-19]
在每个设备上运行(即vb01 , vb1和vb2 ): sudo ip route add 224.0.0.0/4 dev eth1 解决了这个问题。 在物理环境中它没有这样做。 不知道为什么我们必须像这样在虚拟环境中运行它。 vagrant@vb0:~$ route Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface default 10. ... -
Socat - 虚拟串行网络(Socat - Virtual serial network)[2022-03-26]
通过使用ip套接字作为“代理”,Socat可用于创建网络串行端口。 这是可以用于我们要创建的每个端口的命令: sudo socat ip:localhost:222 pty,raw,echo=0 Socat can be used for creating a network o serial port by using a ip socket as a "broker". This is the command that can be used for each port that we want to ... -
2016年2月10日更新: 我在ORSSerialPort github问题列表中与创建者armadsen讨论了情况: 我认为基本方法是在InternalSerialPort和SerialPort中“交换”初始化程序,以便路径初始化程序是指定/必需的初始化程序,IOKit初始化程序是可选的。 已经如此(正如您所注意到的)路径(不是io_object_t)在内部用于获取文件描述符以及对端口的读/写。 换句话说,我希望这不是一个非常复杂的变化。 在此之后,我做了一个概念验证实现,它适用于“仅有filedescr ...