首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >CSS:添加位置固定使标题转到右边?

CSS:添加位置固定使标题转到右边?
EN

Stack Overflow用户
提问于 2014-03-27 18:23:59
回答 1查看 108关注 0票数 0

http://codepen.io/anon/pen/potcD

在标题css中,为什么当我添加位置时:固定的专题讨论会文本会一直往左走?

EN

回答 1

Stack Overflow用户

发布于 2014-03-27 19:17:54

我不知道你想做什么。

我玩过一点..。请查查我的CodePen叉你的工作。

HTML

代码语言:javascript
运行
复制
<header><div class="logo">symposiums</div></header>
<div class="content">
  <p>
1.a convivial meeting, usually following a dinner, for drinking and intellectual conversation.<br>
2.( initial capital letter, italics ) a philosophical dialogue (4th century b.c.) by Plato, dealing with ideal love and the vision of absolute beauty.</p>
<p>i realize that i have to live, to experience life and to do new things everyday. That is the antidote for boredom, procrastination and sulking. Don't let things be a routine, or else time will just fly by. Twas a good night.</p><br>
<p>And we gotta be a superhero, a renaissance man, against this all. everyones need an outlet for expression,  a skill in the arts, music, dance, writing, etc.</p>
and i need to put my feet on the ground, remember i am not special, pay my dues, and still put my mind in the skies.
<br><br><br><br><p><center>The mind is it's own place, and in itself can make a heaven of hell or a hell of heaven. John Milton.</p>

<h2>I WONDER</h2></center>

  <p>I'm too emasculated for this shit
  <br>jobs, aren't they buying part of your life? and i want family and freedom<br>
  <font color="red"> but of course you won't feel anything, not accomplishment nor desire, if you don't put seriousness and passion into</font></p>

  <p>Twenty years from now you will be more disappointed by the things that you didn't do than by the ones you did do. So throw off the bowlines.  Sail away from the safe harbor.  Catch the trade winds in your sails.  Explore.  Dream.  Discover.</p>

  <p>the thing is it doesn't matter how much you read. there is a certain extent, you have to do, to experience, and nothing can replace that. what do i do?</p>

</div>

CSS

代码语言:javascript
运行
复制
header
    {
      margin: 0;
  position:fixed;
  width: 100%;
  top: 0;

    background: #BDBDBD;
    font-size: 250%; 
    line-height: 200%; 
    opacity: 0.5;
height: 72px;
    }

header .logo {
  width: 35%;
  left: 22%;
  margin: 0 auto;
  position: absolute;
    font-family: georgia;
    font-variant: small-caps;
}

header .logo:first-letter
    {
    text-transform: uppercase;
    color: red;
    font-family: times;
    }

body 

    {
    cursor: crosshair; 
    font-family: helvetica; 
    font-size: 90%; 
    opacity: .7;
    }


h2 

    {
    font-family: arial, helvetica; 
    font-weight: bold; 
    font-size: 550%; 
    text-shadow: 0 1px 1px grey;
    }



.content

    {
margin: 80px auto;
    text-align: left;
    width: 35%;
    border: 2px dotted grey;
    padding: 0 4% 15% 4%;
    }
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/22696096

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档