إنني أقوم بعمل رسالة منبثقة باستخدام css و html. أنا أحاول أن أجعل التخطيط المنبثق أكثر استجابة ولكن مع معرفة CSS محدودة ، فأنا عالق. في الأساس أنا لا أريد أن أجبر div
مع وحدات بكسل ثابتة قدر الإمكان. أيضا ، يا Button
و Anchor url
هي أيضًا مضمنة مع موقع الإصلاح في CSS. كيف يمكنني تحسين ذلك؟
عندما تظهر الشاشة المنبثقة ، أريد أن أذهب إلى الصفحة خلفها باللون الرمادي. ولكن ، يبدو أنها تعمل في jsfiddle ولكن عندما أضعها على صفحة الويب الخاصة بي ، أرى فقط نصف الصفحة باللون الرمادي عند عرض النافذة المنبثقة. كيف يمكنني جعل الصفحة الكاملة تظهر باللون الرمادي؟
يرجى الاطلاع هنا: http://jsfiddle.net/chs9x9wj/274/
ستظهر النافذة المنبثقة كما يلي:
المغلق:
div.outer {
position: relative;
width: 300px;
height: 270px;
border: 3px solid black;
text-align: center;
margin:auto;
z-index: 100;
background-color: yellow;
}
div.outer a {
color: blue;
}
div.inner-right {
position: absolute;
top: 80px;
right: 10px;
width: 240px;
height: 100px;
/*border: 3px solid blue;*/
text-align: left;
}
div.inner-left {
position: absolute;
top: 80px;
left: 10px;
width: 20px;
height: 100px;
/*border: 3px solid red;*/
color: red;
}
div.inner-buttom {
position: absolute;
top: 180px;
left: 120px;
text-align: center;
}
.prompt-backdrop {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: black;
opacity: .8;
z-index: 99;
}
لغة البرمجة:
<!DOCTYPE html>
<html>
<body>
<button onclick="myFunction()">Show me the Pop Up</button>
<div class="prompt-backdrop" id="backdrop" style="visibility: hidden"></div>
<br/>
<div class="outer" id="myPopup" style="visibility: hidden">
<a>!</a>
<br/><br/>
<a>This div element has position: relative</a>
<div class="inner-right">
This is a fact: <br/> <br/>
The human eye can distinguish about 10 million different colors.
</div>
<div class="inner-left">
!
</div>
<div class="inner-buttom">
<input type="submit" class="like" value="Next" />
<p><a href="google.com">Go Back</a></p>
</div>
</div>
</body>
</html>
جافا سكريبت:
function myFunction() {
document.getElementById("myPopup").style.visibility = "visible";
document.getElementById("backdrop").style.visibility = "visible";
}