html - 你怎么能 "un-rotate"已经旋转的对象中的元素?

标签 html css

我在尝试创建导航栏时遇到了一些问题。我一直想制作一个侧面导航栏部分,该部分具有菱形链接,这些链接可以并排向下(菱形链接非常类似于 http://thedrawingroomcreative.com/ 。但是,我旋转了整个链接本身以制作菱形但是我想知道我是否可以取消旋转容器内的对象。我仍在开始学习 html、css、javascript、jquery 等的一些基础知识,所以任何东西都有帮助。(这是我正在为学校设计的网站俱乐部)

HTML:

    <ul class="navbar1">
    <li>
       <!--Here we welcome visitors to our site and hopefully direct them to specific pages-->
       <a href="Home.aspx" title="Home Page">Home</a>
    </li>
    <li>
       <!--Here we talk about the school itself, it's technology courses (with pictures), about tsa, and our objectives as a club(link to contact info page)-->
       <a href="about.aspx">About Us</a>
    </li>
    <li>
        <!--List both participants in the club and advisors w/ a picture-->
        <a href="members.aspx">Members</a>
    </li>
    <li>
        <!--give a short paragraph of 'trying anything you want, have fun'. have a link to tsa list of competitions and the latest verision of the rules book-->
        <a href="comp.aspx">Competitions</a>
    </li>
    <li>
        <!--A quick update on how to join (with a link to contact info) and post some of the important forms nedded to join-->
        <a href="join.aspx">Join Us</a>
    </li>
  </ul>

  <!-- END OF LIST #1 -->

  <!-- --------------------------------------------------------------------------------------- -->

  <!-- LIST #2, STAGGERED TO THE RIGHT OF LIST #1 -->

  <ul class="navbar2">
    <li>
       <!--Quickly address the national TSA organization and va TSA, with links to both pages-->
       <a href="Chapter.aspx">Our Chapter</a>
    </li>
    <li>
        <!--Address our design brief and provide a link to our design brief website-->
        <a href="brief.aspx">Design Brief</a>
    </li>
    <li>
        <!--List important dates needed to know and current 'meeting' dates and work dates-->
        <a href="event.aspx">Events</a>
    </li>
    <li>
        <!--List important contact info for the school and advisors plus the school tsa email-->
        <a href="info.aspx">Contact Info</a>
    </li>
  </ul>

CSS:

       ul.navbar1 {
       font-family: 'Century Gothic', "Times New Roman", sans-serif;
       display: inline;
       text-align: center;
       list-style-type: none;
       padding: 0;
       margin: 0;
       width: 100%;
       position: absolute;
       top: 10%;
   }
   ul.navbar1 li {
       padding: 10px;
       border: 3px solid black;
       font-size: 145%;
       /*DIAMOND SHAPE*/
       width: 70px; 
       height: 70px; 
       margin: 3px 0 50px 30px;
       /* Rotation */
       -webkit-transform: rotate(-45deg);
       -moz-transform: rotate(-45deg);
       -ms-transform: rotate(-45deg);
       -o-transform: rotate(-45deg);
       transform: rotate(-45deg);
   }
   ul.navbar1 a {
       text-decoration: none;
       display: block;
       color: #01244E;
   }
   ul.navbar2 {
       font-family: 'Century Gothic', "Times New Roman", sans-serif;
       display: inline;
       text-align: center;
       list-style-type: none;
       padding: 0;
       margin: 0;
       width: 100%;
       position: absolute;
       top: 19.25%;
   }
   ul.navbar2 li {
       padding: 10px;
       border: 3px solid black;
       font-size: 145%;
       /*DIAMOND SHAPE*/
       width: 70px; 
       height: 70px; 
       margin: 3px 0 50px 104px;
       /* Rotation */
       -webkit-transform: rotate(-45deg);
       -moz-transform: rotate(-45deg);
       -ms-transform: rotate(-45deg);
       -o-transform: rotate(-45deg);
       transform: rotate(-45deg);
   }
   ul.navbar2 a {
       text-decoration: none;
       display: block;
       color: #01244E;
   }

最佳答案

尝试用相反的值旋转:

   ul.navbar2 a {
       text-decoration: none;
       display: block;
       color: #01244E;
       /* Rotation */
       -webkit-transform: rotate(45deg);
       -moz-transform: rotate(45deg);
       -ms-transform: rotate(45deg);
       -o-transform: rotate(45deg);
       transform: rotate(45deg);
   }

关于html - 你怎么能 "un-rotate"已经旋转的对象中的元素?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21219694/

相关文章:

javascript - 让 div 在屏幕上移动

css - 为什么浏览器不呈现由 "white-space: pre"元素内的尾随换行符引起的换行符?

html - 响应式 CSS Div 宽度

css - 如何在CSS中正确继承?

jquery - 输入字段和 gldatepicker 显示间隙

html - 棘手的 iframe 嵌入 - 不会很好地播放

html - iOS7 和 Safari 7 中翻转动画的奇怪渲染

javascript - getElementsByClassName 找不到 uls

html - 为什么 HTML/CSS 下拉菜单链接在第一次点击时无法点击,只有第二次以上点击有效?

css - 如何更改 Inspinia 中左侧菜单的背景颜色