简体   繁体   English

无法删除Wordpress网站上的表格边框

[英]Cannot remove table borders on a Wordpress site

It works if I put the code into a blank HTML file on my desktop, but not on the Website. 如果将代码放在桌面上的空白HTML文件中,而不在网站上,则可以使用。 I have always had trouble removing table borders from Wordpress Websites. 我一直很难从Wordpress网站上删除表格边框。 This is the code that I have so far: 这是我到目前为止的代码:

HTML 的HTML

  <table border="0" cellspacing="0" cellpadding="0">
   <td>
      <a href="http://graysonforeman.com/portfolio/websites/">
      <img src="http://graysonforeman.com/wp-content/uploads/2016/03/mrs.jpg" height="175"     width="175"></a>
   <td><a href=" http://graysonforeman.com/portfolio/writing/">
      <img src="http://graysonforeman.com/wp-content/uploads/2016/03/pen_paper_2-512.png" height="175" width="175"></a>
   </td>
   <td><a href="http://graysonforeman.com/portfolio/programming/">
      <img src="http://graysonforeman.com/wp-content/uploads/2016/03/Java.png" height="175" width="175"></a>
   </td>
   </tr>
   <tr>
      <td>Websites</td>
      <td>Writing</td>
      <td>Programming</td>
</table>

I thought about editing the style sheet, but I do not want to mess up the rest of my theme. 我曾考虑过编辑样式表,但是我不想弄乱其余的主题。 Thank you for any help. 感谢您的任何帮助。

Try using the !important attribute to the style, something like this: 尝试对样式使用!important属性,如下所示:

<table style="border: 0 !important;" cellspacing="0" cellpadding="0">

The !important rule is a way to make your CSS cascade but also have the rules you feel are most crucial always be applied. !important规则是使CSS级联的一种方法,但也要始终应用您认为最关键的规则。 A rule that has the !important property will always be applied no matter where that rule appears in the CSS document. 具有!important属性的规则将始终应用,无论该规则在CSS文档中的位置如何。

See further details here : What does !important in CSS mean? 在此处查看更多详细信息: CSS中的!important是什么意思?

Try clearing the border on your table and td s 尝试清除tabletd上的边框

<style type='text/css'>
table.no_border, table.no_border td{
border:0 !important;
}
</style>
<table border="0" cellspacing="0" cellpadding="0" class='no_border'>
   <tr>
      <td>
         <a href="http://graysonforeman.com/portfolio/websites/">
            <img src="http://graysonforeman.com/wp-content/uploads/2016/03/mrs.jpg" height="175"     width="175">
         </a>
      </td>
      <td>
         <a href=" http://graysonforeman.com/portfolio/writing/">
            <img src="http://graysonforeman.com/wp-content/uploads/2016/03/pen_paper_2-512.png" height="175" width="175">
         </a>
      </td>
      <td>
         <a href="http://graysonforeman.com/portfolio/programming/">
            <img src="http://graysonforeman.com/wp-content/uploads/2016/03/Java.png" height="175" width="175">
         </a>
      </td>
   </tr>
   <tr>
      <td>Websites</td>
      <td>Writing</td>
      <td>Programming</td>
   </tr>
</table>

I also fixed your tr s and one td 我还固定了您的tr和一个td

You can use !important to override the rest. 您可以使用!important覆盖其余部分。 That is the highest priority order. 这是最高优先级顺序。

   <table border="0 ! important" cellspacing="0" cellpadding="0"       class="no_border">

to override another css priority . 覆盖另一个CSS优先级。 I have a video for this https://youtu.be/NqDb9GfMXuo 我为此有一个视频https://youtu.be/NqDb9GfMXuo

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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