我知道这可能与其他一些帖子类似,但我不太清楚我在这里做错了什么.作为一个FYI,我是编程的新手,仍然在努力学习正确的流程.
这是代码,例外情况发生在"MyFriends [i] .Name = friendName".
using System;
using System.Collections;
namespace FriendList
{
class FriendList
{
static public Friend[] MyFriends = new Friend[2];
public static void Main()
{
string friendName;
string friendPhone, friendMonth, friendDay, friendYear;
int intMonth, intDay, intYear;
for (int i = 0; i < 2; ++i)
{
Console.Write("enter name");
friendName = Console.ReadLine();
MyFriends[i].Name = friendName;
Console.Write("phone");
friendPhone = Console.ReadLine();
MyFriends[i].Phone = friendPhone;
Console.WriteLine("Enter Month: ");
friendMonth = Console.ReadLine();
intMonth = Convert.ToInt32(friendMonth);
MyFriends[i].Month = intMonth;
Console.WriteLine("Enter Day: ");
friendDay …
Run Code Online (Sandbox Code Playgroud) 任何人都可以分享如何在封闭div中的页面上包装每个asterix.
以便:
Tasty drinks *
Run Code Online (Sandbox Code Playgroud)
变为:
Tasty drinks <span class="disclaimer">*</span>
Run Code Online (Sandbox Code Playgroud)
我已经尝试了一些在线示例,并且除了星号之外几乎可以使用它.
我无法更改Bootstrap 3中选择元素的border-radius.我尝试更改一些其他属性,如background-color或border-color,这些属性对我有用.唯一不起作用的风格是border-radius.我不知道我做错了什么.
HTML:
<div class="container">
<form role="form" class="form-horizontal" method="get" action="<?php $_SERVER['PHP_SELF']; ?>">
<div class="form-group">
<div class="col-md-6 col-md-offset-3">
<div class="input-group">
<input type="text" class="form-control search-box" placeholder="Search">
<span class="input-group-addon">
<span class="glyphicon glyphicon-search"></span>
</span>
</div>
</div>
</div>
<div class="form-group">
<div class="col-md-6 col-md-offset-3">
<div class="col-md-6">
<select class="form-control"></select>
</div>
<div class="col-md-6">
<select class="form-control"></select>
</div>
</div>
</div>
</form>
</div>
Run Code Online (Sandbox Code Playgroud)
CSS:
body {
padding: 0;
margin: 0;
}
.form-horizontal {
margin-top: 50px;
}
/* Remove border-radius, box-shadow, border-right and transition of input box */
.search-box {
border-radius: 0px; …
Run Code Online (Sandbox Code Playgroud) 我有一个手风琴项目,我用于在页面上阅读更多/更少的链接.
这样做的目的是点击它阅读更多,然后会有几个段落.
我有这个工作,但我需要它在页面加载时保持关闭,此时页面加载项目打开.
我可以添加什么来解决这个问题?
<div class="accordionMod panel-group">
<div class="accordion-item">
<h4 class="accordion-toggle">Read More / Less</h4>
<section class="accordion-inner panel-body">
<p>more info.</p>
<h4 class="title">More titles</h4>
<p>more content</p>
</section>
</div>
</div>
Run Code Online (Sandbox Code Playgroud) 我似乎无法弄清楚我有这个问题:
<script>
function getValues(){
var value1 = document.getElementById("value1");
var value2 = document.getElementById("value2");
var value3 = document.getElementById("value3");
alert(value1 +" "+ value2 +" "+ value3);
}
</script>
<p>value1</p>
<input type="text" id='value1' />
<p>value2</p>
<input type="text" id='value2' />
<p>value3</p>
<input type="text" id='value3' />
<input type="button" value="submit" onclick="getValues()" />
Run Code Online (Sandbox Code Playgroud)
我尝试获取用户填写的值,然后提醒他们,但不是显示他们填写的值,而是说:
[object HTMLInputElement] [object HTMLInputElement] [object HTMLInputElement]
有谁知道可能是什么问题?
如果我position: absolute
在div的内部有一个按钮,则overflow-x: auto
该按钮将对齐容器的边缘。
但是,如果div的内容超出了水平宽度,则滚动后该按钮将保持固定在容器内其开始位置。
似乎absolute
应该将其固定在一边,但似乎并不能解决问题
有什么方法可以将子级内容固定在水平滚动div的右侧吗?
.container {
width: 20rem;
border: 1px solid grey;
padding: 1rem 1rem;
position: relative;
overflow-x: auto;
}
.container button {
position: absolute;
right: 0;
top: 0;
}
Run Code Online (Sandbox Code Playgroud)
<pre class="container">Multi Line Text
Long piece of content that overflows the width of container<button>Copy</button></pre>
Run Code Online (Sandbox Code Playgroud)
css ×3
html ×3
javascript ×3
accordion ×1
c# ×1
class ×1
css-position ×1
dom ×1
input ×1
jquery ×1