[英]Why is there space between tabs?
New to HTML/CSS coding. HTML/CSS 编码的新手。 Every time I plug this code into the CMS I am using, there are white spaces in between the tabs.
每次我将此代码插入我正在使用的 CMS 时,选项卡之间都会有空格。 I have plugged the code into random online editors which does not show the white spaces in between.
我已将代码插入随机的在线编辑器中,中间没有显示空格。 What am I doing wrong?
我究竟做错了什么?
(It's forcing me to write more details). (这迫使我写更多的细节)。 The CMS I am using was developed by an independent, small company so there are some limitations to the editing capabilities.
我使用的 CMS 是由一家独立的小公司开发的,因此编辑功能存在一些限制。 Not sure if that has anything to do with it.
不确定这是否与它有关。
I have (you can ignore the change in titles): 2我有(你可以忽略标题的变化): 2
<style> body { background: #fff; font-family: 'Arial'; }.mytabs { display: flex; flex-wrap: wrap; max-width: 1000px; margin: 50px auto; padding: 0px; }.mytabs input[type="radio"] { display: none; float: left; }.mytabs label { padding: 25px; background: #612141; font-weight: bold; color: #fff; }.mytabs.tab { width: 100%; padding: 20px; background: #fff; order: 1; display: none; border: solid; border: 3px solid #a6192e; }.mytabs.tab h2 { font-size: 2em; }.mytabs input[type='radio']:checked + label +.tab { display: block; }.mytabs input[type="radio"]:checked + label { background: #c1a91e; } </style>
<html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> </head> <body> <div class="mytabs"> <input type="radio" id="tabbananas" name="mytabs" checked="checked"> <label for="tabbananas">Bananas</label> <div class="tab"> </div> <input type="radio" id="tabapples" name="mytabs"> <label for="tabapples">Apples</label> <div class="tab"> </div> <input type="radio" id="taboranges" name="mytabs"> <label for="taboranges">Oranges</label> <div class="tab"> <p> </p> </div> </div> </div> </body> </html>
First of all I couldn't reproduce the issue because it has no whitespace between tabs for me.首先,我无法重现该问题,因为它在标签之间没有空格。 Anyway, I guess this whitespace will be removed if you set labels margin to 0;
无论如何,如果您将标签边距设置为 0,我想这个空格将被删除;
.mytabs>label { margin: 0;important }
i think you should try reset css: https://meyerweb.com/eric/tools/css/reset/ copy this and paste to the top of your css.我认为您应该尝试重置 ZC7A628CBA22E28EB17B5F5C6AE2A266AZ: https://meyerweb.com/eric/tools/css/reset/复制此内容并粘贴到 ZC7A628CBA22E28EB17B5F5C6AE2A266 的顶部。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.