浏览器调整大小时,锚标记会移动

时间:2012-11-28 17:13:03

标签: css

我正在为一个班级的作业工作,当我调整浏览器大小时,我有一个移动锚标记,我希望它保持在笔形图上,你会在这里看到问题:{{ 3}}

谢谢!

CSS:
#contact {
position: fixed;
display: block;
font-family: Century Gothic;
text-decoration: none;
text-align: center;
font-size: 18px;
font-weight: bold;
color: rgb(0, 0, 153);
transform: rotate(-77deg);
line-height: 30px;
width: 150px;
height: 20px;
margin: -300px 0px 0px 1335px;
}

HTML:
    <div id="main-content">
<a href="index.html" id="home">Home</a>
<a href="index.html" id="webcoding">Web<br />Coding<br />seminar<br /><span>Don't miss!</span></a>
<a href="index.html" id="javascript">Javascript<br />10:00</a>
<a href="index.html" id="photoshop">Photoshop<br />Lesson 01 due!</a>
<a href="index.html" id="illustrator">guest speaker<br />Illustrator<br />2:00-3:00</a>
<a href="index.html" id="php">PHP<br />5:00-10:00</a>
    </div>
<a href="index.html" id="contact">Drop us a line!</a>

2 个答案:

答案 0 :(得分:1)

将锚标记移到<div id="main-content">

然后给#main-content position:relative并给锚position:absolute(删除所有固定定位的东西)

您现在可以相对于#main-content div定位锚点,您需要为right赋予它一个负值,但我认为在这种情况下这可能是不可避免的。

您需要调整锚标记的右侧和底部(或顶部)值,但您应该能够使用上述值。

答案 1 :(得分:0)

  1. 将“给我们留言”移至div
  2. position:relative添加到#main-content