首页 > 解决方案 > 我正在尝试删除或更改表格元素的样式

问题描述

当我使用这个 html 代码时:

enter code here

<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width,initial-scale=1">
  <meta name="generator" content="RSD 5.0.3429">
  <title>download</title>
  <link rel="stylesheet" href="css/wireframe-theme.min.css">
  <link rel="stylesheet" href="css/materialize.min.css">
  <script>document.createElement( "picture" );</script>
  <script class="picturefill" async="async" src="js/picturefill.min.js"></script>
  <link rel="stylesheet" href="css/main.css">
  <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Poppins:300,400,b%7CRubik:300,400,500,900,b">
<style>::selection {
    background-color: #4353ff;
    color: white
}</style>
</head>

<body class="body-1 no-js">
  <link rel="stylesheet" href="css/main.css">
  <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Poppins:300,400,b%7CRubik:300,400,500,900,b">
  <nav class="container-grid navigation">
    <div class="container-grid nav-wrapper"><a href="index.html" class="link-container brand-logo left">
        <span class="text-element brand-name">Ecomigrator</span>
      </a>
      <a class="link-text" href="#">Linked Text</a>
      <a class="link-text" href="#">Linked Text</a>
      <div class="container-grid right navigation-links">
        <ul class="list-container navigation-list">
          <li class="list-item-container navigation-list-item">
            <a class="link-text link-item-menu" href="about.html">About</a>
          </li>
          <li class="list-item-container navigation-list-item">
            <a class="link-text link-item-menu" href="contact.html">Contact</a>
          </li>
        </ul>
      </div><a class="glyph right mobile-nav-button hide-on-med-and-up" href="#!"><i class="coffeecup-icons-menu7"></i></a>
    </div>
    <div class="html-element navigation-code">__DATA_HTMLEMBED_47__</div>
  </nav>
<script type="text/javascript"><!--
        function validaform(){
        var ok = true;
         var granParser = "%@@%"
         var parser = "|$|";
         var dias = "";
         var tiempo = "";
             var interests = "";
         for(var i = 1 ; i <8; i++ ){
           if(document.getElementById("d["+i+"]").checked==true){
             if(dias==""){
              dias+= document.getElementById("d["+i+"]").value;
             }else{
              dias+= parser+document.getElementById("d["+i+"]").value;
             }         
           } else{
             if(dias==""){
              dias+= "-";
             }else{
              dias+= parser+"-";
             }              
           }
         }

          for(var i = 1 ; i <4; i++ ){
           if(document.getElementById("t["+i+"]").checked==true){
             if(tiempo==""){
              tiempo+= document.getElementById("t["+i+"]").value;
             }else{
              tiempo+= parser+document.getElementById("t["+i+"]").value;
             }         
           } else{
             if(tiempo==""){
              tiempo+= "-";
             }else{
              tiempo+= parser+"-";
             }              
           }
         }

        for(var i = 1 ; i <13; i++ ){
           if(document.getElementById("z["+i+"]").checked==true){
             if(interests==""){
              interests+= document.getElementById("z["+i+"]").value;
             }else{
              interests+= parser+document.getElementById("z["+i+"]").value;
             }         
           } else{
             if(interests==""){
              interests+= "-";
             }else{
              interests+= parser+"-";
             }              
           }
         }       

         var total = dias + granParser + tiempo + granParser + interests;
         document.Contact.extras.value = total;
         if(document.Contact.email.value==""){
         alert("Please type your E-mail!!");
          ok = false;
         }
         return ok;
        }

</script>

<form id="Contact" action="pf-form-mailer/download.php" method="post" name="Contact" onSubmit="return validaform()">
    <style> .table style{
    width: 25%;
    -webkit-border-horizontal-spacing: 2px;
    -webkit-border-vertical-spacing: 2px;
    border-top-width: 0px;
    border-right-width: 0px;
    border-bottom-width: 0px;
    border-left-width: 0px;
}
</style>
<div>
    <input type="hidden" name="submit_check" value="M"></div>
    <div class="table">
<CENTER>
<TABLE WIDTH=25% CELLPADDING=2 CELLSPACING=2 BORDER=0>
<TR><TD WIDTH=25%>
<BR>
<TABLE  WIDTH=25% CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD WIDTH=30%><font color="red">Name:</font> </TD><TD WIDTH=70%>
<input required name="name" type="TEXT" cols=30></TD></TR>
<TR><TD WIDTH=30%><font color="black">Title:</font> </TD><TD WIDTH=70%>
<input name="title" type="text" cols=30></TD></TR>
<TR><TD WIDTH=30%><font color="red">Company:</font></TD><TD WIDTH=70%>
<input required name="company" type="TEXT" cols=30></TD></TR>
<TR><TD WIDTH=30%>Street: </TD><TD WIDTH=70%>
<input name="address" type="TEXT" cols=30></TD></TR>
<TR><TD WIDTH=30%>City: </TD><TD WIDTH=70%>
<input name="city" type="TEXT" cols=30></TD></TR>
<TR><TD WIDTH=30%>State: </TD><TD WIDTH=70%>
<input name="state" type="TEXT" cols=2></TD></TR>
<TR><TD WIDTH=30%>Zip Code: </TD><TD WIDTH=70%>
<input name="zipcode" type="TEXT" cols=14></TD></TR>
<TR><TD WIDTH=30%>Telephone: </TD><TD WIDTH=70%>
<input name="phone" type="TEXT" cols=14 size="20">
</TD></TR><TR><TD WIDTH=30%>
<font color="red">Email:</font></TD><TD WIDTH=70%>
<input required name="mail" type="TEXT" cols=30></TD></TR>
</TABLE>

</TD><TD WIDTH=50%>

<TABLE WIDTH=100% CELLPADDING=6 CELLSPACING=2 BORDER=0>

<TR><TD WIDTH=50% ALIGN=CENTER HEIGHT=35 COLSPAN=2>
<input type="SUBMIT" value="Download"></TD>

</TR></TABLE>
</TD></TR></TABLE>

email: <A HREF="mailto:info@ecomigrator.com">info@ecomigrator.com</A>
</CENTER>
</div>
</form>
<BR>
    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGE- MENT. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.<BR>
<BR>
  <div class="container-grid container-footer-wrapper">
    <div class="container-grid container-footer">
      <div class="container-grid container-14">
        <a class="link-text logo-footer" href="index.html">
          <font face="Rubik, sans-serif">Ecomigrator</font>
        </a>
      </div>
      <div class="container-grid container-16">
        <h6 class="info-title-footer">Contact</h6>
        <div class="container-grid container-18">
          <a class="link-text info-link" href="index.html#pricing">Pricing</a>
          <a class="link-text info-link" href="about.html#team">About</a>
          <a class="link-text info-link" href="#">info@ecomigrator.com</a>
        </div>
      </div>
      <div class="container-grid container-17">
        <h6 class="social-title-footer">Social</h6>
        <div class="container-grid container-19"><a href="#" target="_blank" class="social-image social-icon-1"><img class="twitter-icon" src="./socialicons/webicon-twitter.png" alt="Social Icon"></a><a href="#" target="_blank" class="social-image social-icon-1"><img class="instagram-icon" src="./socialicons/webicon-instagram.png" alt="Social Icon"></a><a href="#" target="_blank" class="social-image social-icon-1"><img class="facebook-icon" src="./socialicons/webicon-facebook.png" alt="Social Icon"></a></div>
      </div>
    </div>
  </div>
  <script src="js/jquery.min.js"></script>
  <script src="js/outofview.js"></script>
  <script src="js/materialize.min.js"></script>
  <script>M.AutoInit();</script>
</body>

</html>

我明白了

chrome中代码的屏幕截图

如果我删除这两个语句:

链接 rel="stylesheet" href="css/wireframe-theme.min.css" 链接 rel="stylesheet" href="css/materialize.min.css"

我得到:

chrome中的代码

我想要图 1 中的顶部样式,但我想要图 2 中的表格(表格)我只想关闭表格(表格)的样式表。我尝试将 div 放在带有 class=".nostyle" 的表格内容中,其中 .nostyle 是样式 .nostyle{all: none|revert|initial|unset} ,表格中没有任何变化。有没有办法按照我想要的方式获取表格(表格)?

标签: stylesheet

解决方案


推荐阅读