小编Sur*_*lai的帖子

如何在文本框中插入值以选择选项

HTML

<input type="text" value="" id="ip1" class="ip1" />
<input type="button" value="Add" class="bt1" id="bt1">    
</br>          
<select>
 <option value="volvo">Volvo</option>
 <option value="saab">Saab</option>
</select>
Run Code Online (Sandbox Code Playgroud)

JQUERY

 $(document).ready(function(e) {
   $(".bt1").click(function(){
     var opt = $("#ip1").val();
   });
 });         
Run Code Online (Sandbox Code Playgroud)

嗨朋友在这里我想从文本框中添加值来使用jquery选择选项,我从文本框中获取值但不知道如何插入,帮助我.

html javascript css jquery jquery-ui

3
推荐指数
1
解决办法
3206
查看次数

以css为中心的盒子 - 错误的对齐

使用css创建居中框时遇到问题.现在我有这个:http: //jsfiddle.net/LW7mN/2/

.trex-clear-all{
    display: inline-block;
    width: 99%;
    height: 17px;
    font-size: 12px !important;
    text-align: -webkit-right !important;
    text-align: right;
}
#trex_showonhover{
    visibility:hidden;
    background-color:#FFFFFF;
    border:1px solid #999999;
    cursor:default;
    position:absolute;
    text-align:center;
    width: 280px;
    z-index:100;
    -moz-border-radius: 15px;
    border-radius: 15px;
    padding: 10px 10px 10px;
}
#trex_close_div{
    top:6px;
    right:6px;
    position:absolute;
}    
.trex_showdiv{
    width:310px;
    float: right;
}

.trex-text-title{
    font-family: 'Segoe UI_', 'Open Sans', Verdana, Arial, Helvetica, sans-serif !important;
    font-size: 11px !important;
    font-weight:700 !important;
    padding: 2px !important;
}


.trex-new-widget-container {
    font: 10pt normal Arial, sans-serif;
    height: auto; …
Run Code Online (Sandbox Code Playgroud)

html css css3

3
推荐指数
1
解决办法
75
查看次数

在多个id中应用CSS在jquery中不起作用

我正在尝试使用jquery为我的部门应用宽度.以下代码对我来说很好.

$('#bodycontainer').css('width','300px'); 
$('#footer').css('width','300px');
Run Code Online (Sandbox Code Playgroud)

但是当将两个id组合并将其作为单个规则保持不起时就不起作用了.见下文.

$('#bodycontainer','#footer').css('width','300px');
Run Code Online (Sandbox Code Playgroud)

我在这做错了什么?

的jsfiddle

html javascript css jquery

2
推荐指数
1
解决办法
62
查看次数

针对空类

我想套用green background段落red一个所有其他人.我已经完成了一半,但仍在努力解决空 class="":

p {background:green}

#test p:not([class]) {
  background: red;
  color: #fff;
}
Run Code Online (Sandbox Code Playgroud)
<div id="test">
  <p>This should be red</p>
  <p class="abc">This should be green</p>
  <p class="newname">This should be green</p>
  <p class="">This should be red</p>
  <p class="anothername">This should be green</p>
  <p>This should be red</p>
  <p class="">This should be red</p>
</div>
Run Code Online (Sandbox Code Playgroud)

小提琴

有人知道吗?

css css3

2
推荐指数
1
解决办法
49
查看次数

Boostrap 5 - 3 列布局和文本右对齐

我正在创建一个个人资料页面。

<!DOCTYPE html>
<html lang="en">

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="description" content="">
  <meta name="author" content="Mark Otto, Jacob Thornton, and Bootstrap contributors">
  <meta name="generator" content="Hugo 0.80.0">
  <title>Detailed View</title>

  <link rel="canonical" href="">

  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BmbxuPwQa2lc/FVzBcNJ7UAyJxM6wuqIj61tLrc4wSX0szH/Ev+nYRRuWlolflfl" crossorigin="anonymous">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.4.0/font/bootstrap-icons.css">

  <!-- Favicons -->
  <link rel="apple-touch-icon" href="https://getbootstrap.com/docs/5.0/assets/img/favicons/apple-touch-icon.png" sizes="180x180">
  <link rel="icon" href="https://getbootstrap.com/docs/5.0/assets/img/favicons/favicon-32x32.png" sizes="32x32" type="image/png">
  <link rel="icon" href="https://getbootstrap.com/docs/5.0/assets/img/favicons/favicon-16x16.png" sizes="16x16" type="image/png">
  <link rel="manifest" href="https://getbootstrap.com/docs/5.0/assets/img/favicons/manifest.json">
  <link rel="mask-icon" href="https://getbootstrap.com/docs/5.0/assets/img/favicons/safari-pinned-tab.svg" color="#7952b3">
  <link rel="icon" href="https://getbootstrap.com/docs/5.0/assets/img/favicons/favicon.ico">
  <meta name="theme-color" content="#7952b3">

  <!-- Custom styles for this template --> …
Run Code Online (Sandbox Code Playgroud)

twitter-bootstrap bootstrap-4

2
推荐指数
1
解决办法
133
查看次数

How to arrange two html buttons horizontally in a single line with equal width by completely fills the screen size

Here i want to use two buttons which cover the entire screen width and the buttons should have equal width. And alo there should not be any space between these buttons.

I tried with the following HTML and CSS codes but i didn't get what i expect;

CSS

#container
{
    width:100%
}         
#button1
{
    width:50%;
}
#button2
{
    width:50% 100%;
}
Run Code Online (Sandbox Code Playgroud)

HTML

<div id="container">
  <button id="button1">Button1</button>
  <button id="button2">Button2</button>
</div>
Run Code Online (Sandbox Code Playgroud)

I tried the code here here the buttons not covering the …

html css

1
推荐指数
1
解决办法
1万
查看次数

在javascript中使用鼠标调整文本/ div的大小

我正在寻找一种非常简单的方法来让用户能够调整文本大小.我想要一个带有句柄的单词或段落的框,允许用户调整框的大小.然后框内的文本自动调整大小以适应新框.

如何创建类似于下面屏幕的手柄?

我能找到的唯一例子是VistaPrints网站.

截图

在此输入图像描述

这是该页面的链接:

javascript css size jquery resize

1
推荐指数
1
解决办法
1万
查看次数

CSS菜单背景

任何想法是什么?两个菜单项之间的白框.(用红色圈出) 在此输入图像描述

CSS:

 #navigation {
    list-style-type: none;
    margin: 0;
    padding: 0;
    vertical-align: middle;
    line-height: 50px;
}

#navigation a {
    text-decoration: none;
    display: inline-block;
    padding-bottom: 15px;
    color: #383838;
    webkit-transition: color 0.4s;
    -moz-transition: color 0.4s;
    -ms-transition: color 0.4s;
    -o-transition: color 0.4s;
    transition: color 0.4s;
}

#navigation a:hover {
    color: #6A98DD;
}

#navigation li {
    display: inline-block;
    padding-left: 9px;
    padding-right: 10px;
    color: #383838;
    background: #EEE;
    webkit-transition: color 0.4s;
    -moz-transition: color 0.4s;
    -ms-transition: color 0.4s;
    -o-transition: color 0.4s;
    transition: color 0.6s;
    webkit-transition: background 0.4s;
    -moz-transition: …
Run Code Online (Sandbox Code Playgroud)

html css

0
推荐指数
1
解决办法
48
查看次数

尝试将悬停:应用于我制作的 Tailwind CSS 自定义类,但它似乎不起作用

例子:

.btn {bg-blue-500 text-2 text-orange-300}
.btn2 {bg-orange-500 text-2 text-blue-300}
Run Code Online (Sandbox Code Playgroud)

尝试过:

编辑:很抱歉我忘记包含我正在使用的代码......那是深夜。

< button className="btn hover:btn2"/>   <---this does not work btn2 does not actually get applied as a hover
Run Code Online (Sandbox Code Playgroud)

btn当然会出现,但是悬停时,btn2样式不会出现。

如果我做了一些愚蠢的事情或者我明显错过了文档中已经说明的内容,请随时为我指出方向。

我尝试过搜索,但我在兜圈子,我只是有很多样式,我想通过在不同的状态下应用它们来改变功能,但这将是一个痛苦,因为我必须创建一个单独的.btn .btn2 btn2-hover btn-hover等。 。 ETC..

是变体问题吗?css或者它是一个按一定顺序读取的过程?难道我期望将悬停应用于所有内部,css而实际上并没有这样做?或者我需要做出一些例外吗?我很混乱。

css hover next.js tailwind-css

0
推荐指数
1
解决办法
5920
查看次数