I am trying to make the Card as i call it attached to the screen so when it is resized, the card will go along with it.
Css code:
#wrapper {
position: relative;
max-width: 1920px;
max-width: 100%;
padding-right: 10px;
padding-left: 10px;
}
#introduction-container {
position: relative;
}
#introduction-textposition {
position: absolute;
bottom: 100%;
left: 10%;
}
#introduction-paragraph {
width: 500px;
height: 150px;
background-color: rgba(18, 18, 18, 0.7);
padding: 40px 25px;
margin-top: 0;
}
html code
<div id="wrapper">
<div id="introduction-container">
<div id="introduction-textposition">
<div id="introduction-paragraph">
<h3>RTX 2080Ti Available Now!</h3>
<h1>RAY-TRACE</h1>
<p><span style="color: rgb(118, 185, 0);">NVIDIA RTX</span> is the most advanced platform for ray tracing and AI technologies that are revolutionizing the ways we play and create</p>
<div>
<a href="#" >SHOP NOW!</a>
</div>
</div>
</div>
</div>
ps: the introduction-textposition percentaged is me playing around with it, wont work tho. problem is, when i used the relative position on #introduction-container it the properties wont show here; html image
What it should look like: illustration
CodePudding user response:
Try this (Open it in "full page" mode)
* {
box-sizing: border-box;
}
body {
margin: 0;
}
#wrapper {
position: relative;
max-width: 1920px;
max-width: 100%;
padding-right: 10px;
padding-left: 10px;
min-height: 100vh;
}
#introduction-paragraph {
width: 400px;
background-color: rgba(18, 18, 18, 0.7);
padding: 40px 25px;
margin-top: 0;
position: absolute;
bottom: 10%;
left: 10%;
}
<div id="wrapper">
<div id="introduction-paragraph">
<h3>RTX 2080Ti Available Now!</h3>
<h1>RAY-TRACE</h1>
<p><span style="color: rgb(118, 185, 0);">NVIDIA RTX</span> is the most advanced platform for ray tracing and AI technologies that are revolutionizing the ways we play and create</p>
<div>
<a href="#" >SHOP NOW!</a>
</div>
</div>
</div>
CodePudding user response:
Let me help my bro, maybe my css can help you
#wrapper{
background-image: linear-gradient(#1391ff,#0145ff);
width: 200px;
height: 160px;
position: absolute;
top: 100%;
left: 100%;
text-align: center;
border-radius: 16px;
padding: 120px 50px;
box-shadow: 2px 2px 8px #000000ab;
}
<div id="wrapper">
<div id="introduction-container">
<div id="introduction-textposition">
<div id="introduction-paragraph">
<h3>RTX 2080Ti Available Now!</h3>
<h1>RAY-TRACE</h1>
<p><span style="color: rgb(118, 185, 0);">NVIDIA RTX</span> is the most advanced platform for ray tracing and AI technologies that are revolutionizing the ways we play and create</p>
<div>
<a href="#" >SHOP NOW!</a>
</div>
</div>
</div>
</div>
