AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-16340554

Afrose ahamed's questions

Martin Hope
Afrose ahamed
Asked: 2025-04-09 16:01:47 +0800 CST

如何修复 z-index 堆栈问题

  • 4

我的背景图像与 card::after 重叠,我试图将 card::after 分配到 card 类后面,但是当背景图像渲染时我看不到 card::after 类,我为 .background-image 添加了 z-index:0,为 .card 添加了 z-index:1,为 .card::after 伪类添加了 z-index:-1

我需要背景位于 .card::after 后面,而 .card::after 位于 card 后面。请参考下面的图片和代码

在背景图像呈现之前按预期显示 .card::after 在此处输入图片描述

背景图像渲染后不显示 .card::after 在此处输入图片描述

.image-wrapper {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;  
}

.background-img {
    width: 100vw;
    height: 100vh;
    background-size: 100%;
    z-index: 0;
}

.overlay-text {
    position: absolute;
    top: 10%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 3rem;
    font-weight: 900;
    text-shadow: 1px 1px 2px #000;
    border: 1px solid #FF5733;
    background-color: #FF5733;
    padding: 0 6rem;
    border-radius: 10px;
}

.sticky-notes {
    position: absolute;
    top: 25%;
    left: 0;
    right: 0;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
    padding: 20px;
    max-width: 1600px; /* Controls how wide the card row is */
    justify-content: center;
    cursor: pointer;
}
.card {
    width: 250px;
    height: 250px;
    color: white;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-family: 'Arial', sans-serif;
    position: relative;
    z-index: 2; /* Ensures the card is above the background image */
}

.card::after{
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 14px; /* slightly more than the card to match the curve */
    background: red;
    z-index: -1; /* behind the card */
}
.appreciator, .text{
    font-weight: 400;
    font-size: 0.8rem;
    white-space: nowrap;      /* Prevents text from wrapping */
    overflow: hidden; 
}

.avatar img {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    margin: 0 auto;
}

.appreciate-text{
    font-size: 1.3rem;
    font-weight: 700;
    text-align: center;
    margin-top: 10px;
}


.icon-buttons {
    display: flex;
    justify-content: center;
    gap: 30px; /* space between like & comment icons */
    margin-top: 10px;
}


.navigation-buttons {
    position: absolute;
    top: 50%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 30px;
    transform: translateY(-50%);
    pointer-events: none; /* allows click-through by default */
}

.arrow-button {
    background-color: orangered;
    color: white;
    font-size: 2rem;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    pointer-events: auto; /* re-enables interaction on buttons */
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 10px rgba(0,0,0,0.3);
}

.arrow-button:hover {
    background-color: rgba(0, 0, 0, 0.8);
}
        <div class="image-wrapper">
                <img src={backgroundImageUrl} alt="background" class="background-img" />
                <div class="overlay-text">
                    <h1>WALL OF FAME</h1>
                </div>
                <div class="create-appreciation">
                        <lightning-button label="Create Appreciation" variant="brand" onclick={handleCreateAppreciation} class="create-button"></lightning-button>
                </div>    
        </div>

        <div class="navigation-buttons">
                <lightning-button-icon icon-name="utility:arrow_left" alternative-text="Delete" variant="bare-inverse" size="large"   class="arrow-button left-arrow"></lightning-button-icon>
                <lightning-button-icon icon-name="utility:arrow_right" alternative-text="Delete" variant="bare-inverse" size="large"   class="arrow-button left-arrow"></lightning-button-icon>
            </div>
        

        <div class="sticky-notes">
                <template for:each={appreciations} for:item="note">
                        <div key={note.Id} class="card" style={note.style}>
                                <div class="note-content">
                                        <h2 class="appreciator">{note.name}</h2>
                                        <div class="avatar">
                                                <img src="https://www.lightningdesignsystem.com/assets/images/avatar2.jpg" alt="avatar" />
                                            </div>
                                            <div class="text">is appreciated</div>
                                            <div class="appreciate-text">{note.appreciated}</div>        
                                </div>
                           <div>    <div class="icon-buttons">    
                                    <lightning-button-icon icon-name="utility:like" alternative-text="Delete" title="Delete" onclick={handleDelete} data-id={note.Id} class="delete-button"></lightning-button-icon>
                                    <lightning-button-icon icon-name="utility:comments" alternative-text="Delete" title="Delete" onclick={handleDelete} data-id={note.Id} class="delete-button"></lightning-button-icon>
                                        </div>  
                           </div>   
                        </div>
                </template>  
        </div>              

html
  • 1 个回答
  • 54 Views
Martin Hope
Afrose ahamed
Asked: 2024-10-29 11:50:03 +0800 CST

如何更改工具提示 charJS 中的值

  • 6

我正在使用 LightningWebCharts,这里是文档链接https://salesforcelabs.github.io/LightningWebChartJS/

我想在工具提示值中添加“k”。工具提示文档https://salesforcelabs.github.io/LightningWebChartJS/docs/api/attributes/tooltip.html

<c-chart type="bar" responsive="true">
     <c-dataset labels='["Item 1","Item 2","Item 3","Item 4", "Item 5","Item 6","Item 7"]'>
      <c-data label="Neutral" detail='[10,20,30,40]' backgroundcolor='rgba(50, 150, 237, 1)' stack="1" ></c-data>
      <c-data label="Warning" detail='[10,20,30","40"]' backgroundcolor='rgba(119, 185, 242, 1)' stack="1"></c-data>
      <c-data label="Error" detail='["10","20","30","40"]' backgroundcolor='rgba(157, 83, 242, 1)' stack="1"></c-data>
     </c-dataset>
     <c-cartesian-axis axis="x" stacked="true" >
     </c-cartesian-axis>
     <c-cartesian-axis axis="y" stacked="true"></c-cartesian-axis>
    <c-tooltip enabled="true" filter={myCustomTooltipFunction}></c-tooltip>
    </c-chart>

 myCustomTooltipFunction(tooltipItems){
        console.log('called',JSON.stringify(tooltipItems))
        console.log(tooltipItems.value+'k')
        return (tooltipItems.value+'k')
        
    }

是否可以在工具提示值中添加“k”?当我在控制台上显示“k”的值时,但它没有显示在工具提示中。我需要返回回调对象吗?但我不确定该怎么做。

在此处输入图片描述

charts
  • 1 个回答
  • 20 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    重新格式化数字,在固定位置插入分隔符

    • 6 个回答
  • Marko Smith

    为什么 C++20 概念会导致循环约束错误,而老式的 SFINAE 不会?

    • 2 个回答
  • Marko Smith

    VScode 自动卸载扩展的问题(Material 主题)

    • 2 个回答
  • Marko Smith

    Vue 3:创建时出错“预期标识符但发现‘导入’”[重复]

    • 1 个回答
  • Marko Smith

    具有指定基础类型但没有枚举器的“枚举类”的用途是什么?

    • 1 个回答
  • Marko Smith

    如何修复未手动导入的模块的 MODULE_NOT_FOUND 错误?

    • 6 个回答
  • Marko Smith

    `(表达式,左值) = 右值` 在 C 或 C++ 中是有效的赋值吗?为什么有些编译器会接受/拒绝它?

    • 3 个回答
  • Marko Smith

    在 C++ 中,一个不执行任何操作的空程序需要 204KB 的堆,但在 C 中则不需要

    • 1 个回答
  • Marko Smith

    PowerBI 目前与 BigQuery 不兼容:Simba 驱动程序与 Windows 更新有关

    • 2 个回答
  • Marko Smith

    AdMob:MobileAds.initialize() - 对于某些设备,“java.lang.Integer 无法转换为 java.lang.String”

    • 1 个回答
  • Martin Hope
    Fantastic Mr Fox msvc std::vector 实现中仅不接受可复制类型 2025-04-23 06:40:49 +0800 CST
  • Martin Hope
    Howard Hinnant 使用 chrono 查找下一个工作日 2025-04-21 08:30:25 +0800 CST
  • Martin Hope
    Fedor 构造函数的成员初始化程序可以包含另一个成员的初始化吗? 2025-04-15 01:01:44 +0800 CST
  • Martin Hope
    Petr Filipský 为什么 C++20 概念会导致循环约束错误,而老式的 SFINAE 不会? 2025-03-23 21:39:40 +0800 CST
  • Martin Hope
    Catskul C++20 是否进行了更改,允许从已知绑定数组“type(&)[N]”转换为未知绑定数组“type(&)[]”? 2025-03-04 06:57:53 +0800 CST
  • Martin Hope
    Stefan Pochmann 为什么 {2,3,10} 和 {x,3,10} (x=2) 的顺序不同? 2025-01-13 23:24:07 +0800 CST
  • Martin Hope
    Chad Feller 在 5.2 版中,bash 条件语句中的 [[ .. ]] 中的分号现在是可选的吗? 2024-10-21 05:50:33 +0800 CST
  • Martin Hope
    Wrench 为什么双破折号 (--) 会导致此 MariaDB 子句评估为 true? 2024-05-05 13:37:20 +0800 CST
  • Martin Hope
    Waket Zheng 为什么 `dict(id=1, **{'id': 2})` 有时会引发 `KeyError: 'id'` 而不是 TypeError? 2024-05-04 14:19:19 +0800 CST
  • Martin Hope
    user924 AdMob:MobileAds.initialize() - 对于某些设备,“java.lang.Integer 无法转换为 java.lang.String” 2024-03-20 03:12:31 +0800 CST

热门标签

python javascript c++ c# java typescript sql reactjs html

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve