我正在Bootstrap 3中工作并尝试删除按钮的阴影/轮廓.我目前的代码部分地执行了此操作.单击按钮时,轮廓仍会显示为瞬间.
这是我的codepen的链接.
.btn:active,
.btn:focus,
.btn.active {
background-image: none;
outline: 0;
-webkit-box-shadow: none;
box-shadow: none;
}
Run Code Online (Sandbox Code Playgroud) 我的输入边框有问题.当我更改边框宽度属性时,它会更改整个输入的宽度.但是,我希望输入的宽度为100%.这是我的代码:
CSS
#wrapper {
width: 170px;
}
textarea {
border-color: #eee;
border-width: 1px;
}
label, textarea, input {
width: 100%;
display: block;
}
input {
border-style: solid;
border-width: 1px;
}
Run Code Online (Sandbox Code Playgroud)
<div id="wrapper">
<form>
<label for="comments">Comments</label>
<textarea name="comments" rows="5"></textarea>
<label for="date">Date</label>
<input type="text" name="date">
<label for="time">Time</label>
<input type="text" name="time">
<label for="longitude">Longitude</label>
<input type="text" name="logitude">
<label for="latitude">Latitude</label>
<input type="text" name="latitude">
</form>
<div>
Run Code Online (Sandbox Code Playgroud)
注意输入几乎延伸到文本区域,但不完全.谢谢!
我正在创建一个应用程序,允许用户检查摄氏或华氏的当地天气和温度.但是,在点击温度时切换两种单元类型时遇到问题.这是我演示的链接.
这是我的Javascript代码:
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(function(position) {
$.getJSON("https://crossorigin.me/http://api.openweathermap.org/data/2.5/weather?lat=" + position.coords.latitude + "&lon=" + position.coords.longitude + "&units=imperial&appid=a62849f462c6573114f32a691f5d3c3f", function(json) {
var all = JSON.stringify(json);
var weather = JSON.stringify(json.weather[0]["description"]);
weather = weather.slice(1, -1);
var tempFahrenheit = JSON.stringify(json.main.temp);
var tempCelsius = JSON.stringify(json.main.temp * 2);
$("#weather").html(weather);
$("#temp").html(Math.floor(tempFahrenheit) + " °<span id='units'>F</span>");
$("#units").on('click', function() {
if ($(this).text() == "F") {
$("#temp").html(Math.floor(tempCelsius) + " °<span id='units'>C</span>");
} else {
$("#temp").html(Math.floor(tempFahrenheit) + " °<span id='units'>F</span>");
}
});
});
});
}
Run Code Online (Sandbox Code Playgroud)