如何将 link 定位到右上角区域? (以header为相对的绝对定位)
How can I position the link to the top right area? (Absolute positioning with a header as a relative)
我正在尝试将动漫 Link 移到右上角区域,但做不到。只能这样做,但它的最大位置是直到另一个 header 的底部。我是这方面的绝对新手。
我设法做了什么
#Header {
position:fixed;
background-color:#FFFFFF;
width: 100%;
height: 8%;
top:0px;
}
#Header h1{
margin-top:0px;
position: relative;
}
#Header a{
color:rgb(255,0,0);
}
#Header h3{
position:absolute;
top: 0px;
right: 0px
margin-top:0px;
}
<div id=Header>
<h1>
imsmoothlikebutter
</h1>
<h3>
<a href= "anime" Target="Blank"> Anime</a>
</h3>
</div>
我想你忘记了第 18 行的分号。
#Header {
position:fixed;
background-color:#FFFFFF;
width: 100%;
height: 8%;
top:0px;
}
#Header h1{
margin-top:0px;
position: relative;
}
#Header a{
color:rgb(255,0,0);
}
#Header h3{
position:absolute;
top: 0px;
right: 0px; /* You forgot a semi-colon on this line */
margin-top:0px;
}
<div id=Header>
<h1>
imsmoothlikebutter
</h1>
<h3>
<a href= "anime" Target="Blank"> Anime</a>
</h3>
</div>
我正在尝试将动漫 Link 移到右上角区域,但做不到。只能这样做,但它的最大位置是直到另一个 header 的底部。我是这方面的绝对新手。 我设法做了什么
#Header {
position:fixed;
background-color:#FFFFFF;
width: 100%;
height: 8%;
top:0px;
}
#Header h1{
margin-top:0px;
position: relative;
}
#Header a{
color:rgb(255,0,0);
}
#Header h3{
position:absolute;
top: 0px;
right: 0px
margin-top:0px;
}
<div id=Header>
<h1>
imsmoothlikebutter
</h1>
<h3>
<a href= "anime" Target="Blank"> Anime</a>
</h3>
</div>
我想你忘记了第 18 行的分号。
#Header {
position:fixed;
background-color:#FFFFFF;
width: 100%;
height: 8%;
top:0px;
}
#Header h1{
margin-top:0px;
position: relative;
}
#Header a{
color:rgb(255,0,0);
}
#Header h3{
position:absolute;
top: 0px;
right: 0px; /* You forgot a semi-colon on this line */
margin-top:0px;
}
<div id=Header>
<h1>
imsmoothlikebutter
</h1>
<h3>
<a href= "anime" Target="Blank"> Anime</a>
</h3>
</div>