用于指定所需边框的终极 CSS 快捷方式
需要一些家庭作业的帮助。我希望有人可以帮助我,因为我已经尝试了所有组合但没有取得多大成功。我被要求简化以下内容:
border-top: 1px solid #8B8BA2;
border-left: 1px solid #8B8BA2;
border-bottom: 1px solid #8B8BA2;
任何人都有任何好主意。我确实尝试了以下方法,但似乎不起作用:
border: 1px solid none solid solid #8B8BA2;
希望有人可以提供帮助。
马里
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
通过指定
border
属性,您可以一次指定所有边框。由于四分之三是相同的,请指定所有边的边框,然后删除不适用的边的边框:Specifying the
border
attribute let's you specify all borders at once. Since three out of four are the same, specify the border for all sides, and then remove the border for the one it doesn't apply to:作为 SeanA 的答案(+1)的补充,-如果这是为了家庭作业,你可能会被问到你是否真的知道速记边界顺序..所以虽然上面的方法也有效,但这可能就是他们想要的答案。
第一个声明所有边框,第二个零是“右”边框,使用四边符号。边框(以及边距和填充)写为
Top - Right - Bottom - Left
- TRBL 用于记住这一点的单词是“TRouBLe”或者你可以顺时针思考:)As an addition to SeanA's answer (+1), - if this is for homework you might be being asked if you actually know the shorthand border order.. so while the above works too, this might be the answer they're after.
the first declares all borders, the second zero's the "right" border, using the four sided notation.. border (and margins and padding) are written
Top - Right - Bottom - Left
- TRBL and the word used to remember this is "TRouBLe" or you can just think clockwise :)