To customize the list item icons to something more relevant to Non Invasive Prenatal Testing (NIPT), such as DNA-related icons, you can integrate an icon library like Font Awesome. This library provides a wide range of icons that can enhance the visual appeal of your content.
Below is the full updated code with the following changes:
- Included Font Awesome: Added the Font Awesome CDN link to access DNA-related icons.
- Updated CSS: Replaced the default checkmark (
✔️) with the DNA icon from Font Awesome.
- Adjusted Styles: Ensured the icons align properly with the text and maintain the desired styling.
Step-by-Step Changes:
-
Include Font Awesome CDN:
Add the Font Awesome <link> tag within the <head> section of your HTML to access the icons.
-
Update the CSS for List Icons:
Modify the .nipt-content-section ul li::before selector to display the DNA icon by setting the appropriate content value and font-family.
-
Ensure Proper Alignment and Styling:
Adjust the positioning and size of the icons to align seamlessly with your list items.
Complete Updated Code:
<!-- Include the Lato font and Font Awesome -->
<link href="https://fonts.googleapis.com/css2?family=Lato:wght@400;700&display=swap" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
<style>
/* ===========================
CSS Variables
=========================== */
:root {
--c-bg-primary: rgba(43, 43, 43, 0.5); /* #2b2b2b with 0.5 opacity */
--c-text-primary: white;
--c-gold: #D1C287;
--c-accent: #4F3F02;
--f-primary: 'Lato', sans-serif;
--s-border-radius: 8px;
--transition-speed: 0.3s;
--container-max-width: 1100px;
--fade-in-duration: 0.6s;
--gradient-start: #D1C287;
--gradient-end: #4F3F02;
}
/* ===========================
Scoped Styles for NIPT Section
=========================== */
.nipt-section-wrapper {
font-family: var(--f-primary);
padding: var(--section-padding);
display: flex;
justify-content: center;
align-items: center;
width: 100%;
box-sizing: border-box;
animation: fadeInSection var(--fade-in-duration) ease forwards;
/* No background-color to ensure transparency */
}
.nipt-container {
display: flex;
flex-direction: row;
max-width: var(--container-max-width);
border-radius: var(--s-border-radius);
overflow: hidden;
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
transition: transform var(--transition-speed), box-shadow var(--transition-speed);
background-color: transparent; /* Ensures section blends with page background */
}
/* Hover effect for container */
.nipt-container:hover {
transform: translateY(-5px);
box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
}
/* ===========================
Image Section
=========================== */
.nipt-image-section {
flex: 1;
min-width: 300px;
display: flex;
align-items: center;
justify-content: center;
background-color: transparent; /* Ensures transparency */
transition: transform 0.5s ease;
}
/* Image Styling */
.nipt-image-section img {
width: 100%;
height: 100%;
object-fit: cover; /* Ensures image covers its container without distortion */
border-radius: var(--s-border-radius) 0 0 var(--s-border-radius);
transition: transform 0.5s ease;
}
/* Scaling effect on image hover */
.nipt-container:hover .nipt-image-section img {
transform: scale(1.05);
}
/* ===========================
Content Section
=========================== */
.nipt-content-section {
flex: 1;
padding: 40px;
color: var(--c-text-primary);
display: flex;
flex-direction: column;
justify-content: center;
position: relative;
}
/* Primary Heading */
.nipt-content-section h1 {
font-size: 2.5em;
color: var(--c-gold);
margin-bottom: 20px;
animation: slideInLeft 0.6s ease forwards;
opacity: 0;
}
/* Secondary Heading with Gradient Text */
.nipt-content-section h2 {
font-size: 1.8em;
margin-bottom: 25px;
background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
-webkit-background-clip: text;
background-clip: text;
color: transparent;
animation: slideInLeft 0.8s ease forwards;
opacity: 0;
}
/* Features List */
.nipt-content-section ul {
list-style: none;
padding: 0;
margin-bottom: 30px;
animation: fadeInList 1s ease forwards;
opacity: 0;
}
.nipt-content-section ul li {
position: relative;
padding-left: 35px; /* Increased padding to accommodate icon */
margin-bottom: 15px;
font-size: 1.1em;
transition: color var(--transition-speed), transform var(--transition-speed);
display: flex;
align-items: center;
}
/* Custom DNA Icon for List Items */
.nipt-content-section ul li::before {
content: '\f471'; /* Unicode for Font Awesome DNA icon */
font-family: 'Font Awesome 6 Free'; /* Updated to Font Awesome 6 */
font-weight: 900; /* Necessary for solid icons */
position: absolute;
left: 0;
color: var(--c-gold);
font-size: 1.2em;
top: 50%;
transform: translateY(-50%);
transition: color var(--transition-speed);
}
/* Hover Effects on List Items */
.nipt-content-section ul li:hover {
color: var(--c-gold);
transform: translateX(5px);
}
.nipt-content-section ul li:hover::before {
color: var(--c-accent);
}
/* Keyframe Animations */
@keyframes fadeInSection {
from {
opacity: 0;
transform: translateY(20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
@keyframes slideInLeft {
from {
opacity: 0;
transform: translateX(-50px);
}
to {
opacity: 1;
transform: translateX(0);
}
}
@keyframes fadeInList {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
/* ===========================
Responsive Design
=========================== */
@media (max-width: 1024px) {
.nipt-container {
flex-direction: column;
}
.nipt-image-section img {
border-radius: var(--s-border-radius) var(--s-border-radius) 0 0;
}
.nipt-content-section {
padding: 30px;
}
.nipt-content-section h1 {
font-size: 2.2em;
}
.nipt-content-section h2 {
font-size: 1.6em;
}
}
@media (max-width: 768px) {
.nipt-image-section {
height: 200px; /* Adjust image height for smaller screens */
}
.nipt-content-section {
padding: 25px;
}
.nipt-content-section h1 {
font-size: 1.8em;
}
.nipt-content-section h2 {
font-size: 1.4em;
}
.nipt-content-section ul li {
font-size: 1em;
}
}
@media (max-width: 480px) {
.nipt-image-section img {
border-radius: var(--s-border-radius) var(--s-border-radius) 0 0;
}
.nipt-image-section {
height: 150px; /* Further adjust image height for mobile devices */
}
.nipt-content-section {
padding: 20px;
}
.nipt-content-section h1 {
font-size: 1.6em;
}
.nipt-content-section h2 {
font-size: 1.2em;
}
.nipt-content-section ul li {
font-size: 0.95em;
}
}
</style>
<!-- NIPT Section -->
<div class="nipt-section-wrapper">
<div class="nipt-container">
<!-- Image Section -->
<div class="nipt-image-section">
<img src="https://longevacare.com/wp-content/uploads/2024/07/030de1b7-cb5c-43d1-86ae-4b01932ee3d6.jpg" alt="Non Invasive Prenatal Testing">
</div>
<!-- Content Section -->
<div class="nipt-content-section">
<h1>Non Invasive Prenatal Testing</h1>
<h2>Non Invasive Prenatal Screening / Testing of Fetal Trisomy:</h2>
<ul>
<li>Analysis of Fetal Cell-Free DNA in Maternal Blood</li>
<li>99% Proven Accuracy for Detection & Low False Positive Rate: Down Syndrome, Lymphocytic Leukemia, and Edward’s Syndrome.</li>
<li>Based on NGS Bioinformatics</li>
</ul>
<!-- "Learn More" button removed as per request -->
</div>
</div>
</div>
Explanation of Changes:
-
Font Awesome Integration:
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
This line includes the Font Awesome library, enabling the use of various icons, including the DNA icon.
-
Updating the List Item Icons:
.nipt-content-section ul li::before {
content: '\f471'; /* Unicode for Font Awesome DNA icon */
font-family: 'Font Awesome 6 Free'; /* Updated to Font Awesome 6 */
font-weight: 900; /* Necessary for solid icons */
position: absolute;
left: 0;
color: var(--c-gold);
font-size: 1.2em;
top: 50%;
transform: translateY(-50%);
transition: color var(--transition-speed);
}
- Content: The
'\f471' Unicode corresponds to the DNA icon (fa-dna) in Font Awesome 6.
- Font Family & Weight: Specifies the correct Font Awesome font family and weight to display the solid DNA icon.
- Positioning: Centers the icon vertically beside each list item.
-
Adjusting Padding for Icons:
.nipt-content-section ul li {
padding-left: 35px; /* Increased padding to accommodate icon */
}
Ensures there's enough space between the icon and the text.
-
Hover Effects:
The hover effects remain the same, changing the color and slight movement of both the text and the icon for interactivity.
Additional Notes:
-
Font Awesome Version: Ensure you're using the correct version of Font Awesome that includes the fa-dna icon. The provided CDN link is for Font Awesome 6.4.0.
-
Alternative Icons: If you prefer a different icon, you can browse Font Awesome Icons and replace the Unicode value ('\f471') with the corresponding Unicode of your chosen icon.
-
Customization: Feel free to adjust the font-size, color, and other styling properties to better match your website's design aesthetics.
By implementing these changes, your NIPT section will feature visually relevant DNA icons, enhancing the user experience and aligning the icons with the content's theme.