How to reset CSS from multiple HTML files included by require

1

By hint , I'm trying to use normalize.css to zero the styles between require and another, but there is no way, the CSS of the later file completely interferes with the layout of the the previous file. This does not change the rest of the page, the problem is just between them.

If I put just one file okay, it looks perfect, but when I add another it gives problem between them.

HTML with PHP:

 <div class="row">
        <div class="col-md-2"></div>
        <div class="col-md-8">

            <?php
                require "arquivo1.html";
            ?>

        </div>

        <div class="col-md-2"></div>
    </div>
    <br>
    <div class="row">
        <div class="col-md-2"></div>
        <div class="col-md-8">

           <?php
                if ($var1 == "incluiarq");
                require "arquivo2.html";
            ?>
    </div>
    <div class="col-md-2"></div>
    </div

The arquivo1.html (file2 is basically the same, but with different CSS):

<link rel="stylesheet" href="_css/normalize.css">

<style type="text/css">

    ol{margin:0;padding:0}.c1{widows:2;orphans:2;text-indent:86pt;text-align:justify;direction:ltr}.c6{max-width:468pt;background-color:#ffffff;padding:72pt 72pt 72pt 72pt}.c0{font-size:12pt;font-family:"Times New Roman"}.c5{color:inherit;text-decoration:inherit}.c8{font-size:14pt;font-family:"Times New Roman"}.c2{font-weight:bold}.c4{text-decoration:underline}.c3{height:11pt}.c7{font-style:italic}.title{widows:2;padding-top:0pt;line-height:1.15;orphans:2;text-align:left;color:#000000;font-size:21pt;font-family:"Trebuchet MS";padding-bottom:0pt;page-break-after:avoid}.subtitle{widows:2;padding-top:0pt;line-height:1.15;orphans:2;text-align:left;color:#666666;font-style:italic;font-size:13pt;font-family:"Trebuchet MS";padding-bottom:10pt;page-break-after:avoid}li{color:#000000;font-size:11pt;font-family:"Arial"}p{color:#000000;font-size:11pt;margin:0;font-family:"Arial"}h1{widows:2;padding-top:10pt;line-height:1.15;orphans:2;text-align:left;color:#000000;font-size:16pt;font-family:"Trebuchet MS";padding-bottom:0pt;page-break-after:avoid}h2{widows:2;padding-top:10pt;line-height:1.15;orphans:2;text-align:left;color:#000000;font-size:13pt;font-family:"Trebuchet MS";font-weight:bold;padding-bottom:0pt;page-break-after:avoid}h3{widows:2;padding-top:8pt;line-height:1.15;orphans:2;text-align:left;color:#666666;font-size:12pt;font-family:"Trebuchet MS";font-weight:bold;padding-bottom:0pt;page-break-after:avoid}h4{widows:2;padding-top:8pt;line-height:1.15;orphans:2;text-align:left;color:#666666;font-size:11pt;text-decoration:underline;font-family:"Trebuchet MS";padding-bottom:0pt;page-break-after:avoid}h5{widows:2;padding-top:8pt;line-height:1.15;orphans:2;text-align:left;color:#666666;font-size:11pt;font-family:"Trebuchet MS";padding-bottom:0pt;page-break-after:avoid}h6{widows:2;padding-top:8pt;line-height:1.15;orphans:2;text-align:left;color:#666666;font-style:italic;font-size:11pt;font-family:"Trebuchet MS";padding-bottom:0pt;page-break-after:avoid}

</style>

<p class="c1">
    <span class="c2 c8">Loren</span>
</p>
<p class="c1">
    <span class="c0">&nbsp;</span>
</p>
<p class="c1">
    <span class="c0">.</span>
</p>
<p class="c1">
    <span class="c0">&nbsp;</span>
</p>
<p class="c1">
    <span class="c0">Loren ipsumLoren ipsumLoren ipsumLoren ipsumLoren ipsum</span> <span class="c0 c2">Loren ipsum</span></p>
<p class="c1">
    <span class="c0">&nbsp;</span>
</p>
<p class="c1">
    <span class="c0">Loren ipsumLoren ipsumLoren ipsumLoren ipsum</span>
</p>
<p class="c1">
    <span class="c0">&nbsp;</span>
</p>
<p class="c1">
    <span class="c0">Loren ipsum,</span> <span class="c0 c7">data venia,</span>
    <span class="c0">Loren ipsumLoren ipsumLoren ipsum</span>
    <span class="c0 c2">Loren ipsumLoren ipsumLoren ipsum</span>

</p>

These files were originally docs made in google drive, and were converted to HTML by google drive itself, so it generates this lot of css, but surprisingly it's perfect :-) when I include only one. >

This one I posted above ( arquivo1.html ) is the entire file I'm including, I removed all the header and closing tags so it would not interfere, and if I put only one okay, but when I put the second problem . Any ideas?

    
asked by anonymous 01.06.2015 / 01:35

1 answer

1

This is possibly because of the specificity of your .css file by overwriting type selectors . I would advise linking to the main .html file normalize .css (just for reset) and another .css for manage style responsibilities eg: main.css ) and in that file make an import of two .css with different styling responsibilities: doc-1.css and doc-2.css )

>

.html file ...

<head>
<link rel="stylesheet" type="text/css" href="css/base/normalize.css">
<link rel="stylesheet/less" type="text/css" href="css/main.css">
</head>

.css file ...

@import "../doc-1.css";
@import "../doc-2.css";
    
28.07.2015 / 20:15