gpt4 book ai didi

html - 根据媒体查询/打印时更改 HTML 元素类名称

转载 作者:行者123 更新时间:2023-11-28 05:35:59 24 4
gpt4 key购买 nike

使用 Skeleton CSS 考虑以下 HTML :

<html>
<head>
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/skeleton.css">
</head>
<body class="container">
<div class="row">
<section class="three columns">
...
</section>
<section id="content" class="nine columns">
...
</section>
</div>
</body>
</html>

我想修改 CSS,以便在打印页面时隐藏 三列 部分,而 九列 部分横跨整个宽度。

前者可以通过媒体查询将 display 设置为 none 来完成。

如何将 content 部分类从 nine columns 更改为 twelve columns 以便内容区域将使用整个宽度打印页面?或者在使用 Skeleton CSS 时可能有更好的方法?

最佳答案

一种可能的方法是覆盖 .nine 类中定义的宽度,就像这样。

@media print {
.nine.columns {
width: 100% !important;
}
}

关于html - 根据媒体查询/打印时更改 HTML 元素类名称,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38214569/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com