gpt4 book ai didi

jquery - 在 React 组件中应用 sass css 时遇到问题

转载 作者:行者123 更新时间:2023-11-28 00:35:46 24 4
gpt4 key购买 nike

我是 web 开发的新手如果不能正确解释问题,请发表评论,这样至少我可以告诉更多。

如果有人能给我一点帮助,我将不胜感激

我有一个 HTML 结构,我试图在其中应用一些 CSS,但由于某种原因无法正常工作。

我在 jsfiddle 中检查了相同的 HTML 和 CSS和 Code-pen 它工作得很好但是当我在我的 react 组件中应用同样的东西时它没有显示任何东西

我的代码:

/*
Common
*/

.wizard,
.tabcontrol {
display: block;
width: 100%;
overflow: hidden;
}

.wizard a,
.tabcontrol a {
outline: 0;
}

.wizard ul,
.tabcontrol ul {
list-style: none !important;
padding: 0;
margin: 0;
}

.wizard ul>li,
.tabcontrol ul>li {
display: block;
padding: 0;
}


/* Accessibility */

.wizard>.steps .current-info,
.tabcontrol>.steps .current-info {
position: absolute;
left: -999em;
}

.wizard>.content>.title,
.tabcontrol>.content>.title {
position: absolute;
left: -999em;
}


/*
Wizard
*/

.wizard>.steps {
position: relative;
display: block;
width: 100%;
}

.wizard.vertical>.steps {
display: inline;
float: left;
width: 30%;
}

.wizard>.steps .number {
font-size: 1.429em;
}

.wizard>.steps>ul>li {
width: 25%;
}

.wizard>.steps>ul>li,
.wizard>.actions>ul>li {
float: left;
}

.wizard.vertical>.steps>ul>li {
float: none;
width: 100%;
}

.wizard>.steps a,
.wizard>.steps a:hover,
.wizard>.steps a:active {
display: block;
width: auto;
margin: 0 0.5em 0.5em;
padding: 1em 1em;
text-decoration: none;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}

.wizard>.steps .disabled a,
.wizard>.steps .disabled a:hover,
.wizard>.steps .disabled a:active {
background: #f3f4fa;
color: #aaa;
cursor: default;
}

.wizard>.steps .current a,
.wizard>.steps .current a:hover,
.wizard>.steps .current a:active {
background: #008cff;
color: #fff;
cursor: default;
}

.wizard>.steps .done a,
.wizard>.steps .done a:hover,
.wizard>.steps .done a:active {
background: #9dc8e2;
color: #fff;
}

.wizard>.steps .error a,
.wizard>.steps .error a:hover,
.wizard>.steps .error a:active {
background: #fd3550;
color: #fff;
}

.wizard>.content {
background: #f3f4fa;
display: block;
margin: 0.5em;
min-height: 35em;
overflow: hidden;
position: relative;
width: auto;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}

.wizard.vertical>.content {
display: inline;
float: left;
margin: 0 2.5% 0.5em 2.5%;
width: 65%;
}

.wizard>.content>.body {
float: left;
position: absolute;
width: 95%;
height: 95%;
padding: 2.5%;
}

.wizard>.content>.body ul {
list-style: disc !important;
}

.wizard>.content>.body ul>li {
display: list-item;
}

.wizard>.content>.body>iframe {
border: 0 none;
width: 100%;
height: 100%;
}

.wizard>.content>.body input {
display: block;
border: 1px solid #ccc;
}

.wizard>.content>.body input[type="checkbox"] {
display: inline-block;
}

.wizard>.content>.body input.error {
background: rgb(251, 227, 228);
border: 1px solid #fbc2c4;
color: #8a1f11;
}

.wizard>.content>.body label {
display: inline-block;
margin-bottom: 0.5em;
}

.wizard>.content>.body label.error {
color: #8a1f11;
display: inline-block;
margin-left: 1.5em;
}

.wizard>.actions {
position: relative;
display: block;
text-align: right;
width: 100%;
}

.wizard.vertical>.actions {
display: inline;
float: right;
margin: 0 2.5%;
width: 95%;
}

.wizard>.actions>ul {
display: inline-block;
text-align: right;
}

.wizard>.actions>ul>li {
margin: 0 0.5em;
}

.wizard.vertical>.actions>ul>li {
margin: 0 0 0 1em;
}

.wizard>.actions a,
.wizard>.actions a:hover,
.wizard>.actions a:active {
background: #008cff;
color: #fff;
display: block;
padding: 0.5em 1em;
text-decoration: none;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}

.wizard>.actions .disabled a,
.wizard>.actions .disabled a:hover,
.wizard>.actions .disabled a:active {
background: #f3f4fa;
color: #aaa;
}

.wizard>.loading {}

.wizard>.loading .spinner {}


/*
Tabcontrol
*/

.tabcontrol>.steps {
position: relative;
display: block;
width: 100%;
}

.tabcontrol>.steps>ul {
position: relative;
margin: 6px 0 0 0;
top: 1px;
z-index: 1;
}

.tabcontrol>.steps>ul>li {
float: left;
margin: 5px 2px 0 0;
padding: 1px;
-webkit-border-top-left-radius: 5px;
-webkit-border-top-right-radius: 5px;
-moz-border-radius-topleft: 5px;
-moz-border-radius-topright: 5px;
border-top-left-radius: 5px;
border-top-right-radius: 5px;
}

.tabcontrol>.steps>ul>li:hover {
background: #edecec;
border: 1px solid #bbb;
padding: 0;
}

.tabcontrol>.steps>ul>li.current {
background: #fff;
border: 1px solid #bbb;
border-bottom: 0 none;
padding: 0 0 1px 0;
margin-top: 0;
}

.tabcontrol>.steps>ul>li>a {
color: #5f5f5f;
display: inline-block;
border: 0 none;
margin: 0;
padding: 10px 30px;
text-decoration: none;
}

.tabcontrol>.steps>ul>li>a:hover {
text-decoration: none;
}

.tabcontrol>.steps>ul>li.current>a {
padding: 15px 30px 10px 30px;
}

.tabcontrol>.content {
position: relative;
display: inline-block;
width: 100%;
height: 35em;
overflow: hidden;
border-top: 1px solid #bbb;
padding-top: 20px;
}

.tabcontrol>.content>.body {
float: left;
position: absolute;
width: 95%;
height: 95%;
padding: 2.5%;
}

.tabcontrol>.content>.body ul {
list-style: disc !important;
}

.tabcontrol>.content>.body ul>li {
display: list-item;
}
<div id="wizard-vertical" role="application" class="wizard clearfix vertical">
<div class="steps clearfix">
<ul role="tablist">
<li role="tab" class="first current" aria-disabled="false" aria-selected="true">
<a id="wizard-vertical-t-0" href="#wizard-vertical-h-0" aria-controls="wizard-vertical-p-0">
<span class="current-info audible">current step: </span>
<span class="number">1.</span> Account</a>
</li>
<li role="tab" class="done" aria-disabled="false" aria-selected="false">
<a id="wizard-vertical-t-1" href="#wizard-vertical-h-1" aria-controls="wizard-vertical-p-1">
<span class="number">2.</span> Profile</a>
</li>
<li role="tab" class="done" aria-disabled="false" aria-selected="false">
<a id="wizard-vertical-t-2" href="#wizard-vertical-h-2" aria-controls="wizard-vertical-p-2">
<span class="number">3.</span> Hints</a>
</li>
<li role="tab" class="last done" aria-disabled="false" aria-selected="false">
<a id="wizard-vertical-t-3" href="#wizard-vertical-h-3" aria-controls="wizard-vertical-p-3">
<span class="number">4.</span> Finish</a>
</li>
</ul>
</div>

<div class="content clearfix">
<h3 id="wizard-vertical-h-0" tabindex="-1" class="title current">Account</h3>
<section id="wizard-vertical-p-0" role="tabpanel" aria-labelledby="wizard-vertical-h-0" class="body current" aria-hidden="false" style="display: block;">
<div class="form-group">
<label>User name *</label>
<input class="form-control" type="text" />
</div>
<div class="form-group">
<label> Password *</label>
<input type="text" class="form-control" />
</div>
<div class="form-group">
<label>Confirm Password *</label>
<input type="text" class="form-control" />
</div>
<div class="form-group">
<label class="col-lg-12">(*) Mandatory</label>
</div>
</section>
<h3 id="wizard-vertical-h-1" tabindex="-1" class="title">Profile</h3>
<section id="wizard-vertical-p-1" role="tabpanel" aria-labelledby="wizard-vertical-h-1" class="body" aria-hidden="true" style="display: none;">
<div class="form-group">
<label> First name *</label>
<input type="text" class="form-control" />
</div>
<div class="form-group">
<label> Last name *</label>
<input type="text" class="form-control" />
</div>

<div class="form-group">
<label>Email *</label>
<input type="text" class="form-control" />
</div>

<div class="form-group">
<label>Address *</label>
<input type="text" class="form-control" />
</div>

<div class="form-group">
<label class="col-lg-12">(*) Mandatory</label>
</div>
</section>

<h3 id="wizard-vertical-h-2" tabindex="-1" class="title">Hints</h3>
<section id="wizard-vertical-p-2" role="tabpanel" aria-labelledby="wizard-vertical-h-2" class="body" aria-hidden="true" style="display: none;">
<div class="form-group">
<div class="col-lg-12">
<ul>
<li>Jonathan Smith </li>
<li>Lab</li>
<li>jonathan@example.com</li>
<li>Your city, Cityname</li>
</ul>
</div>
</div>

</section>
<h3 id="wizard-vertical-h-3" tabindex="-1" class="title">Finish</h3>
<section id="wizard-vertical-p-3" role="tabpanel" aria-labelledby="wizard-vertical-h-3" class="body" aria-hidden="true" style="display: none;">
<div class="form-group">
<div class="col-lg-12">
<div class="checkbox checkbox-primary">
<input id="checkbox-v" type="checkbox" />
<label for="checkbox-v">
I agree with the Terms and Conditions.
</label>
</div>
</div>
</div>
</section>

</div>
<div class="actions clearfix">
<ul role="menu" aria-label="Pagination">
<li class="disabled" aria-disabled="true">
<a href="#previous" role="menuitem">Previous</a></li>
<li aria-hidden="false" aria-disabled="false" class="" style="display: block;">
<a href="#next" role="menuitem">Next</a></li>
<li aria-hidden="true" style="display: none;">
<a href="#finish" role="menuitem">Finish</a>
</li>
</ul>
</div>
</div>

最佳答案

您必须将 css 文件链接到 HTML 文档。您可以使用 custom.css 是您编写样式的 css 文件。它适用于 jsfiddle,因为我们不必定义 css 文件和 HTML 文档之间的链接

关于jquery - 在 React 组件中应用 sass css 时遇到问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56363938/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com