我的模态窗口的关闭按钮正在滚动内容。如何阻止它滚动。
我在下面提供了html和css代码。
非常感谢任何帮助。
如果您无法提供解决方案但有建议,请提供,我感谢任何帮助。
HTML:
<a href="#india_snapshot" id="login_pop" class="rd-game-content-popupbutton">India Snapshot</a>
<!-- popup of india snapshot -->
<a href="#x" class="overlay" id="india_snapshot"></a>
<div class="popup">
<strong>From Brad's Diary</strong>
<p>A developing country steeped in history, India is quite an experience. It intrigued me with its size and number of people - almost four times the population of the USA at one-third its size. And there are almost as many languages as there are states! It is a mix of tradition and modernism where serene villages co-exist with bustling metros. The people are quite friendly. From what I gathered, the society gives a lot of importance of family values.</p>
<p>Today, India is one of the most powerful economies in South Asia. India's economy is a mixture of village farming, modern agriculture, information technology and a wide range of manufacturing industries. Recent industrial and investment reforms have provided new opportunities for Indian business-persons and an estimated 100 million to 200 million consumers. India has a strong entrepreneurial class and a central government that recognizes the continuing need for market-oriented approaches to economic development.</p>
<br />
<strong>Key Facts and Figures</strong>
<br /><br />
Area<br />
3,287,590 sq Km<br /><br />
Population<br />
More than 1,200,000,000<br /><br />
Capital<br />
New Delhi<br /><br />
National Language<br />
Hindi is the national language. Apart from Hindi, there are about 24 major languages. English is an important language for national, political and commercial communication.<br /><br />
Religion<br />
All religions co-exist peacefully - Hindu, Muslim, Christian, Sikh, Buddhist, Jain and others.<br /><br />
Currency<br />
Rupees. An American dollar is approximately equal to 60 Rupees.<br /><br />
Natural Resources<br />
Coal, Iron Ore, Manganese, Mica, Bauxite, Natural Gas, Limestone etc.<br /><br />
Principal Crops<br />
Rice, Wheat, Oilseeds, Cotton, Sugarcane, Tea and Potatoes.<br /><br />
Major Industries<br />
Textiles, Chemicals, Steel, Cement, Mining, Agriculture, Automobiles and Petroleum.<br /><br />
Major Trading Partners<br />
USA, China, Japan, Germany and Iran.
<a class="close" href="#close"></a>
</div>
CSS:
.overlay {
background-color: rgba(0, 0, 0, 0.6);
bottom: 0;
cursor: default;
left: 0;
opacity: 0;
position: fixed;
right: 0;
top: 0;
visibility: hidden;
z-index: 1;
-webkit-transition: opacity .5s;
-moz-transition: opacity .5s;
-ms-transition: opacity .5s;
-o-transition: opacity .5s;
transition: opacity .5s;
}
.overlay:target {
visibility: visible;
opacity: 1;
}
.popup h2 {
color: #07839f;
line-height: 1.8em
}
.popup {
background-color: #fff;
border: 3px solid #fff;
display: inline-block;
left: 50%;
color: #666;
opacity: 0;
padding: 40px 15px;
position: fixed;
text-align: justify;
top: 40%;
visibility: hidden;
z-index: 10;
-webkit-transform: translate(-50%, -50%);
-moz-transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
-o-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
-ms-border-radius: 10px;
-o-border-radius: 10px;
border-radius: 10px;
-webkit-box-shadow: 0 1px 1px 2px rgba(0, 0, 0, 0.4) inset;
-moz-box-shadow: 0 1px 1px 2px rgba(0, 0, 0, 0.4) inset;
-ms-box-shadow: 0 1px 1px 2px rgba(0, 0, 0, 0.4) inset;
-o-box-shadow: 0 1px 1px 2px rgba(0, 0, 0, 0.4) inset;
box-shadow: 0 1px 1px 2px rgba(0, 0, 0, 0.4) inset;
-webkit-transition: opacity .5s, top .5s;
-moz-transition: opacity .5s, top .5s;
-ms-transition: opacity .5s, top .5s;
-o-transition: opacity .5s, top .5s;
transition: opacity .5s, top .5s;
width: 800px;
max-height: 400px;
overflow: auto;
}
.overlay:target+.popup {
top: 50%;
opacity: 1;
visibility: visible;
}
.close {
background-color: rgba(0, 0, 0, 0.8);
height: 30px;
line-height: 30px;
position: absolute;
right: 0;
text-align: center;
text-decoration: none;
top: 0px;
width: 30px;
-webkit-border-radius: 15px;
-moz-border-radius: 15px;
-ms-border-radius: 15px;
-o-border-radius: 15px;
border-radius: 15px;
}
.close:before {
color: rgba(255, 255, 255, 0.9);
content: "X";
font-size: 24px;
text-shadow: 0 -1px rgba(0, 0, 0, 0.9);
}
.close:hover {
background-color: red;
}
.popup p, .popup div {
margin-bottom: 10px;
}
.popup label {
display: inline-block;
text-align: left;
width: 180px;
}
.popup input[type="text"], .popup input[type="password"] {
margin: 0;
padding: 4px;
background: #d8f6fd;
border: 1px solid #66c8de;
-moz-box-shadow: 0 1px 1px #ddd inset, 0 1px 0 #fff;
-webkit-box-shadow: 0 1px 1px #ddd inset, 0 1px 0 #fff;
box-shadow: 0 1px 1px #ddd inset, 0 1px 0 #fff;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
}
.popup input[type="text"]:hover, .popup input[type="password"]:hover {
background: #fff
}