简体   繁体   English

矩形框,在一个按钮内的文本周围带有圆角

[英]Rectangular box with rounded corners around text within a button

I would like to get the box around Sign Up smaller, ideally, halfway between the text and current state. 我想将Sign Up的框缩小,最好在文本和当前状态之间。

导航栏图像链接

. I am using bootstrap-3. 我正在使用bootstrap-3。 I tried making the btn smaller (btn-sm), it seamed like that is the problem. 我试图使btn变小(btn-sm),就好像是问题所在。 But that doesn't do anything. 但这无济于事。 Here is what I have: 这是我所拥有的:

 .btn { font-family: "Lucida Sans Unicode"; font-size: 18px; } #signup { border-color: #fff; } /*------------------------------------------------- Navigation bar -------------------------------------------------*/ .navbar-toggle { float: left; } .navbar { margin-bottom: 0px; font-family: "Lucida Sans Unicode"; font-size: 18px; } 
 <nav class="navbar navbar-inverse navbar-fixed-top"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="index.html">MyWebsite</a> </div> <div id="navbar" class="navbar-collapse collapse"> <ul class="nav navbar-nav pull-right" > <li><a href="#">Log in</a></li> <!-- I'm trying to get the text in the button below within a rectangle box --> <li><a href="#" class="btn btn-inverse" id="signup">Sign up</a></li> </ul> </div> </div> </nav> 

CSS: CSS:

There is padding/margin between the button and the text, you need to look up at CSS file. 按钮和文本之间有填充/边距,您需要查看CSS文件。 There is two CSS files for bootstrap. 有两个用于引导的CSS文件。

Find btn-sm in both CSS files. 在两个CSS文件中找到btn-sm It will be inside one of them. 它将在其中一个内部。 However I see that you also have btn btn-inverse for button class. 但是我看到您也为按钮类设置了btn btn-inverse Do look at them. 看看他们。

If you want the corners of button to be more cursive, find the border-radius property. 如果您希望按钮的角更加草书,请找到border-radius属性。

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

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