css 文本旋转 - 仅文本,而不是父元素
在此页面上:https://www.bcidaho.com/mammography/
如果您点击“查找筛选中心”出现一个信息表...
我如何旋转最后 5 个单元格中的文本?
显然跨浏览器会有所帮助...这将使表格能够正确适合...
并且我是否必须在 TD 上设置高度才能使其正确适合?
on this page: https://www.bcidaho.com/mammography/
if you click "find a screening center" a table of information comes up...
how can i rotate the text in the last 5 cells?
obviously cross browser would help... this would allow the table to fit properly...
and do i have to set a height on the TDs to make it fit right?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
看看这个页面: https://www.udemy.com/blog/css -旋转文本/
在“使用 CSS 变换属性旋转文本”部分中。
您必须在 CSS 文件中创建一个
class
或id
,并将其应用于要旋转的文本,而不是div
。Take a look at this page: https://www.udemy.com/blog/css-rotate-text/
in the section "Rotating Text with CSS Transform Property".
You have to create a
class
orid
in your CSS file, and apply it to the text you want to rotate, not thediv
.该问题的链接不再有效。我假设用例是您想要在 div 内旋转文本,而不弄乱 div 的宽度、高度、x、y、背景等。例如,如果您直接旋转 div,它的背景也会旋转。
一种解决方案是在父元素中嵌套旋转元素。
The link the question no longer works. I'm going to assume the use case is that you want to rotate text within e.g. a div, without messing up the div's width, height, x, y, background, etc. E.g., If you were to rotate the div directly, its background would also be rotated.
1 solution is to nest a rotated element within the parent element.