Remove fieldset boarder and box-shadow from legend element

萝らか妹 提交于 2019-12-11 13:13:08

问题


I am trying to remove the background lines and shadows from the area where my legend is. Once I set the background to transparent in the legends property I can still see the lines. My code is as follows

HTML:

<fieldset>
<legend>text goes here</legend>
</fieldset>

CSS:

fieldset {
        margin:20px;
        padding:0 10px 10px;
        border:1px solid #666;
        border-radius:10px;
        box-shadow:0 0 10px #666;
        padding-top:10px;
 }  
 legend {
     margin: 0px 5px;
     padding: 5px;
     white-space: nowrap;
     background: transparent ; 
     font-weight: bold;
     font-size: 2em;
 }

Any suggestions on how to fix this?


回答1:


This will do the trick

fieldset {
    border: 0;
}



回答2:


The border and box-shadow are on the fieldset. Just add the following and it should work:

fieldset{
   border:0;
   box-shadow: none;
}


来源:https://stackoverflow.com/questions/19529312/remove-fieldset-boarder-and-box-shadow-from-legend-element

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!