You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

在Unqork开发应用:如何将单选按钮样式改为标准Learn More按钮

Style Unqork Radio Buttons to Match Learn More Button

Hey there! I’ve worked with Unqork’s styling system before, so let’s get your radio buttons looking exactly like that Learn More button without switching control types. Here’s a step-by-step solution tailored to your existing CSS:

Step 1: Hide the Default Radio Input

First, we’ll hide the native radio button since we’re replacing it with a custom styled label (this keeps the radio’s functionality intact while letting us control the appearance):

/* Target Unqork's radio input element (adjust selector if needed) */
.unq-radio-component input[type="radio"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  z-index: -1; /* Ensure it doesn't interfere with clicks */
}

Step 2: Style the Radio Label to Match Your Button

Use the radio button’s associated label to replicate your primary button’s appearance—we’ll reuse all the properties from your existing .btn.btn-primary class:

/* Style the radio label to mirror your Learn More button */
.unq-radio-component label {
  border-radius: 6px;
  border: solid 2px #01a7e1;
  background-color: #FFFFFF;
  color: #01a7e1;
  display: block;
  font-size: 1.8rem;
  line-height: 1.44;
  margin: 0 auto;
  padding: 10px;
  text-align: center;
  transition: background-color .25s ease, width .13s ease-in, color .18s ease-out;
  width: 188px;
  cursor: pointer;
  position: relative;
}

Step 3: Add Hover & Focus States

Match the hover/focus behavior from your existing button to keep interaction consistency:

/* Hover and focus states for the custom radio label */
.unq-radio-component label:hover,
.unq-radio-component input[type="radio"]:focus + label {
  background-color: #0099cc;
  color: #FFFFFF;
  width: 251px;
}

Step 4: Add Selected State Styling

When the radio button is checked, we’ll keep the active button style (adjust this if you want a distinct selected state):

/* Style for the selected radio button's label */
.unq-radio-component input[type="radio"]:checked + label {
  background-color: #0099cc;
  color: #FFFFFF;
  width: 251px;
  /* Optional: Add a checkmark indicator if desired */
  /* &:after {
    content: '✓';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
  } */
}

Step 5: Integrate with Your Container Style (If Needed)

If your radio buttons live inside the same container as your Learn More button, reuse your .abc-quote-option-cta styles to maintain layout consistency:

/* Apply container styling to radio buttons */
.abc-quote-option-cta .unq-radio-component {
  bottom: 38px;
  left: 0;
  right: 0;
  padding-top: 24px;
  position: absolute;
}

.abc-quote-option-cta .unq-radio-component:before {
  background-color: #979797;
  content: '';
  display: block;
  height: 1px;
  left: 62px;
  opacity: .36;
  position: absolute;
  right: 56px;
  top: 0;
}

Important Notes:

  • Adjust Selectors: Unqork’s component classes might vary (e.g., unq-radio instead of unq-radio-component). Use your browser’s developer tools to inspect the radio button element and update the selectors to match your actual DOM structure.
  • Unqork Style Manager: Add these custom styles in the Style Manager at either the module or application level to ensure they apply correctly.

内容的提问来源于stack exchange,提问作者Skipper Lin

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.08 20:42:48