无法理解 css 变换属性

发布于 2024-12-11 10:29:37 字数 1995 浏览 0 评论 0原文

我正在尝试设置博客文章日期的样式,其中年份垂直对齐。出于某种原因,我知道这是我的错,它的位置不正确。试图让它正确冲洗。

css:

a{color:#000; text-decoration:none}
.entry-date{font-family: 'PompadourBlack';}
.sep,.by-author{display:none}
h2.entry-meta{
    -moz-border-radius: 45px;
    -webkit-border-radius: 45px;
    border-radius: 45px;
    display:block;
    background-color:#a8872d;
    width: 100px;
    height: 100px;
    position:relative
}
h2.entry-meta a{width:60px; height:60px; position:absolute; top:20px; left:20px; outline:1px solid #000; display:block}
h2.entry-meta a time{position:absolute; width:100%; height:100%}
h2.entry-meta a time span{display:block; position:absolute}
span.entry-date-month{bottom:0; left:0}
span.entry-date-date{top:0; left:0; font-size:30px}
span.entry-date-year{outline:1px solid #000; top:10px; right:0; width:20px; height:100%;     -webkit-transform: rotate(-90deg); -moz-transform: rotate(-90deg); transform: rotate(-90deg);}

html:

<link rel="stylesheet" type="text/css" href="http://dev.bowdenweb.com/pro/watkins/fonts/pompadour/stylesheet.css" media="screen" />

<h2 class="entry-meta"><a href="http://dev.bowdenweb.com/pro/watkins/blog/?p=5" class="bookmarkdate" title="4:53 pm - October 20, 2011" rel="bookmark">

<span class="sep">Posted on </span>

<time class="entry-date" datetime="2011-10-20T05:18:15+00:00" pubdate>

<span class="entry-date-month">10</span>

<span class="entry-date-date">20</span>

<span class="entry-date-year">2011</span>

</time>

</a> <span class="by-author"> <span class="sep"> by </span> <span class="author vcard"><a class="url fn n" href="#nogo" title="View all posts by laura666" rel="author">laura666</a></span> </span> </h2>

查看 http://jsfiddle.net/jalbertbowdenii/RmqQ6/4/

i'm trying to style a blog post date, where the year is aligned vertically. for some reason, i know its my fault, its not positioning correctly. trying to get it flushed right.

css:

a{color:#000; text-decoration:none}
.entry-date{font-family: 'PompadourBlack';}
.sep,.by-author{display:none}
h2.entry-meta{
    -moz-border-radius: 45px;
    -webkit-border-radius: 45px;
    border-radius: 45px;
    display:block;
    background-color:#a8872d;
    width: 100px;
    height: 100px;
    position:relative
}
h2.entry-meta a{width:60px; height:60px; position:absolute; top:20px; left:20px; outline:1px solid #000; display:block}
h2.entry-meta a time{position:absolute; width:100%; height:100%}
h2.entry-meta a time span{display:block; position:absolute}
span.entry-date-month{bottom:0; left:0}
span.entry-date-date{top:0; left:0; font-size:30px}
span.entry-date-year{outline:1px solid #000; top:10px; right:0; width:20px; height:100%;     -webkit-transform: rotate(-90deg); -moz-transform: rotate(-90deg); transform: rotate(-90deg);}

html:

<link rel="stylesheet" type="text/css" href="http://dev.bowdenweb.com/pro/watkins/fonts/pompadour/stylesheet.css" media="screen" />

<h2 class="entry-meta"><a href="http://dev.bowdenweb.com/pro/watkins/blog/?p=5" class="bookmarkdate" title="4:53 pm - October 20, 2011" rel="bookmark">

<span class="sep">Posted on </span>

<time class="entry-date" datetime="2011-10-20T05:18:15+00:00" pubdate>

<span class="entry-date-month">10</span>

<span class="entry-date-date">20</span>

<span class="entry-date-year">2011</span>

</time>

</a> <span class="by-author"> <span class="sep"> by </span> <span class="author vcard"><a class="url fn n" href="#nogo" title="View all posts by laura666" rel="author">laura666</a></span> </span> </h2>

check it out http://jsfiddle.net/jalbertbowdenii/RmqQ6/4/

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

莫多说 2024-12-18 10:29:37

不确定我是否正确解释了您的意图,但这里有一个修复:

span.entry-date-year{
 outline: 1px solid #000; 
 width:100%;
 /* if you change this value make sure it's in all three 15px */ 
 height:15px; 
 left: -15px;
 line-height: 15px;
 text-indent: 3px;
 -webkit-transform: rotate(-90deg); 
 -moz-transform: rotate(-90deg); 
 -o-transform: rotate(-90deg);
 -ms-transform: rotate(-90deg);   
 transform: rotate(-90deg);  
 /* this is the property that helps you position the rotation */
 -webkit-transform-origin: top right; 
 -moz-transform-origin: top right;
 -o-transform-origin: top right;
 -ms-transform-origin: top right;
 transform-origin: top right;
}

http://jsfiddle.net/6LpjX/< /a>

Not sure if I'm interpreting your intention right, but here is a fix:

span.entry-date-year{
 outline: 1px solid #000; 
 width:100%;
 /* if you change this value make sure it's in all three 15px */ 
 height:15px; 
 left: -15px;
 line-height: 15px;
 text-indent: 3px;
 -webkit-transform: rotate(-90deg); 
 -moz-transform: rotate(-90deg); 
 -o-transform: rotate(-90deg);
 -ms-transform: rotate(-90deg);   
 transform: rotate(-90deg);  
 /* this is the property that helps you position the rotation */
 -webkit-transform-origin: top right; 
 -moz-transform-origin: top right;
 -o-transform-origin: top right;
 -ms-transform-origin: top right;
 transform-origin: top right;
}

http://jsfiddle.net/6LpjX/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文