简体   繁体   English

为什么选项卡之间有空格?

[英]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 want: 1我要: 1

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>&nbsp;</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.我认为您应该尝试重置 ZC7A62​​8CBA22E28EB17B5F5C6AE2A266AZ: https://meyerweb.com/eric/tools/css/reset/复制此内容并粘贴到 ZC7A62​​8CBA22E28EB17B5F5C6AE2A266 的顶部。

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

相关问题 Windows / Tab之间的javascript / jquery内存空间 - javascript / jquery memory space between windows / tabs 在“AirJordan”和“NewBalance”标签之间添加一个空格 - VUEJS - Adding a space between the words "AirJordan" and "NewBalance" tabs - VUEJS 如何删除反应导航顶部栏中选项卡之间的空白 - How to remove white space between the tabs in react navigation top bar 为什么我的两个幻灯片之间有很大的空间? - Why is there a huge space in between my two slideshows? 为什么这段代码中的元素之间有少许空格? - Why is there a slight space between elements in this code? $('#tabs a')和$('#tabs')之间的区别.find('a') - Difference between $('#tabs a') and $('#tabs').find('a') 用正则表达式将空格缩进替换为制表符 - Replace space indentations into tabs with regex 我的代码在字符串和变量之间添加空格? 为什么这样做呢? - My code is adding a space between the string and the variable? Why is it doing that? 为什么在两个'div'之间的动画期间有一个空的空间? - Why during animation between two 'div' there is an empty space? 使用AJAX加载页面时,为什么我的URL之间没有空格? - Why is there no space between my URLs when page is loaded with AJAX?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM