简体   繁体   English

为什么我的CSS不能将div定位在页面的右侧?

[英]Why my CSS does not position my div to the right side of the page?

I have a div element which contains the language selection links like below: 我有一个div元素,其中包含如下所示的语言选择链接:

<head>
    ...
    <link rel="stylesheet" type="text/css" href="css/page.css">
</head>
<body>
  <div id="#language">
        <a href="#french">French</a> |
        <a href="#english">English</a>
  </div>
  ...
  ...
</body>

I try to CSS the position of #language div to the right side of the page by ( css/page.css ): 我尝试通过( css / page.cssCSS #language div在页面右侧的位置:

#language {
    text-decoration: none;

    position:absolute;
    right:0px;
}

But it does not work, why? 但这不起作用,为什么?

Remove the # from <div id="#language"> and it should work. <div id="#language">删除# ,它应该可以工作。

Example: http://jsfiddle.net/jasongennaro/83naR/ 示例: http //jsfiddle.net/jasongennaro/83naR/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM