-
-
Save hazratbilal0079/5e5df6233d8c173610d01f1de217672b to your computer and use it in GitHub Desktop.
Grid Card layout with fixed Background in HTML and CSS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.fixed-overlay-card { | |
position: relative; | |
width: 100%; | |
max-width: 1200px; /* Adjust as needed */ | |
height: 420px; | |
margin-bottom: 20px; /* Space between cards */ | |
border-radius: 8px; | |
overflow: hidden; | |
display: flex; | |
align-items: center; | |
justify-content: center; | |
} | |
.card-image { | |
position: absolute; | |
top: 0; | |
left: 0; | |
width: 100%; | |
height: 100%; | |
} | |
.card-image img { | |
width: 100%; | |
height: 100%; | |
object-fit: cover; /* Adjust the image to cover the area */ | |
z-index: 0; | |
} | |
.card-content { | |
position: relative; | |
width: 100%; | |
height: 100%; | |
padding: 15px; /* Padding around the content */ | |
box-sizing: border-box; | |
color: #333; /* Text color for better readability */ | |
z-index: 1; | |
background: rgba(255, 255, 255, 0.8); /* Semi-transparent white background for contrast */ | |
border-radius: 8px; | |
} | |
.card-content h3 { | |
margin: 0 0 15px; /* Margin below the title */ | |
font-size: 20px; /* Updated font size */ | |
color: #333; /* Dark color for the title */ | |
} | |
.field-row { | |
display: flex; | |
flex-wrap: wrap; | |
gap: 10px; /* Space between fields */ | |
margin-bottom: 15px; /* Space below rows */ | |
} | |
.field { | |
flex: 1 1 calc(33.33% - 10px); /* Three fields per row */ | |
padding: 10px; | |
background: rgba(255, 255, 255, 0.9); /* White background with slight transparency */ | |
border-radius: 4px; | |
border: 1px solid #ddd; | |
box-sizing: border-box; | |
} | |
.field p { | |
margin: 0; | |
font-size: 14px; | |
color: #333; /* Dark color for the text */ | |
} | |
.buttons { | |
display: flex; | |
gap: 10px; | |
margin-top: 10px; | |
} | |
.buttons button { | |
border: none; | |
padding: 10px 15px; | |
color: #fff; | |
border-radius: 4px; | |
cursor: pointer; | |
font-size: 14px; | |
transition: background-color 0.3s ease; | |
} | |
.buttons .edit { | |
background-color: #007bff; | |
} | |
.buttons .delete { | |
background-color: #dc3545; | |
} | |
.buttons .publish { | |
background-color: #28a745; | |
} | |
@media (max-width: 768px) { | |
.field-row { | |
flex-direction: column; | |
} | |
.field { | |
width: 100%; | |
} | |
.buttons { | |
flex-direction: column; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="fixed-overlay-card"> | |
<div class="card-image"> | |
<img src="https://vipprops.ae/wp-content/uploads/jet-form-builder/2172fde49301047270b2897085e4319d/2024/09/Ocean-terrace.jpg" alt="Ocean Terrace"> | |
</div> | |
<div class="card-content"> | |
<h3>Hazrat Bilal Timber/Twing Card Layout with fix Background 05</h3> | |
<div class="field-row"> | |
<div class="field">Field 1: Value</div> | |
<div class="field">Field 2: Value</div> | |
<div class="field">Field 3: Value</div> | |
</div> | |
<div class="field-row"> | |
<div class="field">Field 4: Value</div> | |
<div class="field">Field 5: Value</div> | |
<div class="field">Field 6: Value</div> | |
</div> | |
<div class="field-row"> | |
<div class="field">Field 7: Value</div> | |
<div class="field">Field 8: Value</div> | |
<div class="field">Field 9: Value</div> | |
</div> | |
<div class="field-row"> | |
<div class="field">Field 10: Value</div> | |
<div class="field">Field 11: Value</div> | |
<div class="field">Field 12: Value</div> | |
</div> | |
<div class="field-row"> | |
<div class="field">Field 13: Value</div> | |
<div class="field">Field 14: Value</div> | |
<div class="field">Field 15: Value</div> | |
</div> | |
<div class="buttons"> | |
<button class="edit">Edit</button> | |
<button class="delete">Delete</button> | |
<button class="publish">Publish</button> | |
</div> | |
</div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment