Как заставить @media print работать без использования! Important для каждого стиля css? - PullRequest
0 голосов
/ 17 июня 2020

Мой файл печати css не работает. Единственная причина, по которой я могу изменить стили при печати, - это добавить ко всему "! Important". Все, что я прочитал, говорит не использовать это. Как заставить его работать без использования! Important?

Заголовок css ссылки:

Печать css:

@ media print {# универсальная навигация, .module_global-navigation, .wrapper, #alert, #languageTranslate, .global-footer, # universal-footer, .module_ c {display: none; }

.hero {
    background-color: transparent !important;
    border-bottom: none !important;
}


h1 {
    font-family: initial !important;
    font-size: initial !important;
    color: #000 !important;
    border-bottom: none !important;
    margin: 1rem 0 !important;
    padding: initial !important;
    text-align: left !important;
}

p,
a {
    font-family: initial !important;
    font-size: initial !important;
    color: #000 !important;
    margin: 1rem 0 !important;
    padding: initial !important;
}

a {
    text-decoration: underline !important;
}

a::after {
    content: ' (' attr(href) ')';
    font-style: italic;
    word-wrap: break-word;

}

#content {
    padding: 0 !important;
    width: 100% !important;
}

h1 { font-size: 2.25rem !important; }
h2 { font-size: 2rem !important; }
h3 { font-size: 1.75rem !important; }
h4 { font-size: 1.5rem !important; }
h5 { font-size: 1.25rem !important; }
h6 { font-size: 1rem !important; }

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed, 
figure, figcaption, footer, header, hgroup, 
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0 !important;
padding: 0 !important;
border: 0 !important;
font-size: 100% !important;
font: inherit !important;
vertical-align: baseline !important;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure, 
footer, header, hgroup, menu, nav, section {
display: block !important;
}
body {
line-height: 1 !important;
}
ol, ul {
list-style: none !important;
 }
blockquote, q {
quotes: none !important;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: '' !important;
content: none !important;
}
table {
border-collapse: collapse !important;
border-spacing: 0 !important;
}

}

@page {
size: auto;
margin: 0.5in;
}
...