简体   繁体   中英

make an html page with unique css/ ignoring most the universal app css

Most of the html follow aa basic layout but one page needs to be a timeline, but it conflicts with current universal app css and as a result the timeline is scattered across screen. Is it possible to just make a new css for just the one page? I the timeline portion is a code snippet so as once I add in the ebr it doesn't need to touched at all.

Maybe you can wrap the page in an element styled like this:

.wrapper {
    all: initial;
}

.wrapper * {
    all: unset;
}

This will reset all styles of all elements inside the wrapper

Yes you can create a css style file for that page then, just put the styles you need to be different from the others, then import both styles to the html file but the special styles bellow the general styles ie:

styles.css

h1{
    font-size:2em;
}

specific.css

h1{
    font-size:1,5em;
}

specific.html

<link href=“styles.css” />
<link href=“specific.css” />

So in this order the second style file will override the first one, Hope it helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM